Add patch by Stephan Beyer to improve process_keys' input parsing,
authormyon <myon@b513b33f-fedd-0310-b452-c3deb5f4c849>
Fri, 18 Jul 2008 13:34:49 +0000 (13:34 +0000)
committermyon <myon@b513b33f-fedd-0310-b452-c3deb5f4c849>
Fri, 18 Jul 2008 13:34:49 +0000 (13:34 +0000)
remedying to need of weird grep and sed commands. (Closes: #370571)

git-svn-id: svn://svn.debian.org/pgp-tools/trunk@390 b513b33f-fedd-0310-b452-c3deb5f4c849

debian/changelog
keyanalyze/analyze.sh
keyanalyze/process_keys.1
keyanalyze/process_keys.c

index 390e81611da39fd0661c1b550f1ff7ea3438a616..7c2cbbda097aea1091e176169b82caa2c5b9a761 100644 (file)
@@ -10,10 +10,12 @@ signing-party (1.1-1) UNRELEASED; urgency=low
     + Add patch to flatten output structure for small keyrings.
       (Closes: #309101)
     + Update config.{sub,guess}. (Closes: #365148)
+    + Add patch by Stephan Beyer to improve process_keys' input parsing,
+      remedying to need of weird grep and sed commands. (Closes: #370571)
   * Put examples in .../examples/$prog, not the other way round.
   * Use dh_lintian.
 
- -- Christoph Berg <myon@debian.org>  Fri, 18 Jul 2008 15:18:42 +0200
+ -- Christoph Berg <myon@debian.org>  Fri, 18 Jul 2008 15:30:06 +0200
 
 signing-party (1.0-2) unstable; urgency=low
 
index b70d14b873a891c41f6d88ba15f4a956de197c15..65bc57750973a5d44935d58c92f77ba11da62d6a 100755 (executable)
@@ -5,11 +5,7 @@ make
 
 # comment these next lines out if you are working with an existing
 # preprocess.keys file
-pgpring -S -k $1                                                       \
-       | grep "\(pub\|sig\|rev\|uid\)"                                 \
-       | sed -e "s/^\([a-z]*\).*:\([0-9A-F]\{16\}\):.*/\1 \2/g"        \
-               -e "s/^uid:.*/uid/"     > all.keys
-cat all.keys | process_keys $2 > preprocess.keys
+pgpring -S -k "$1" | process_keys $2 > preprocess.keys
 
 # the actual processing of the main report
 keyanalyze
index 86c5edcfb7f5a3f5f290eedc50de6a6ebf217d70..a6eff5385dd37d6764346e018571ae2ed2b6fda7 100644 (file)
@@ -20,6 +20,11 @@ process_keys \- Web of Trust analysis
 and turns it into suitable input for
 .BR keyanalyze (1).
 
+.B pgpring
+must be called with the
+.B -S
+option to also dump signatures.
+
 It acts as a filter, reading from stdin and writing to stdout.
 
 .SH OPTIONS
index acf5c89a3fcf2fdbbea581bcb083e9401f7ebb15..1472a3256e0835ee093da8b96df31a8d74c28998 100644 (file)
@@ -184,7 +184,7 @@ int main (int argc, char *argv[])
 
   while (fgets (buff, sizeof (buff), stdin))
   {
-    if ((s = strtok (buff, " \t\r\n")))
+    if ((s = strtok (buff, ":")))
     {
       if (!strcmp (s, "pub"))
       {
@@ -194,8 +194,12 @@ int main (int argc, char *argv[])
 
        lastuid = &k->uids->next;
        lastsig = &k->uids->sigs;
-       
-       sprintf (k->id, "%.16s", strtok (NULL, " \t\r\n"));
+
+       strtok (NULL, ":");
+       strtok (NULL, ":");
+       strtok (NULL, ":");
+
+       sprintf (k->id, "%s", strtok (NULL, ":"));
       }
       else if (!strcmp (s, "rev"))
        k->rev = 1;
@@ -209,7 +213,7 @@ int main (int argc, char *argv[])
       {
        struct sig *sig = *lastsig = new_sig();
        lastsig = &sig->next;
-       sprintf (sig->id, "%.16s", strtok (NULL, " \t\r\n"));
+       sprintf (sig->id, "%s", strtok (NULL, ":"));
       }
     }
   }