[Pgp-tools-commit] r390 - in trunk: debian keyanalyze

myon at alioth.debian.org myon at alioth.debian.org
Fri Jul 18 13:34:50 UTC 2008


Author: myon
Date: 2008-07-18 13:34:49 +0000 (Fri, 18 Jul 2008)
New Revision: 390

Modified:
   trunk/debian/changelog
   trunk/keyanalyze/analyze.sh
   trunk/keyanalyze/process_keys.1
   trunk/keyanalyze/process_keys.c
Log:
Add patch by Stephan Beyer to improve process_keys' input parsing,
remedying to need of weird grep and sed commands. (Closes: #370571)

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2008-07-18 13:19:41 UTC (rev 389)
+++ trunk/debian/changelog	2008-07-18 13:34:49 UTC (rev 390)
@@ -10,10 +10,12 @@
     + 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 at debian.org>  Fri, 18 Jul 2008 15:18:42 +0200
+ -- Christoph Berg <myon at debian.org>  Fri, 18 Jul 2008 15:30:06 +0200
 
 signing-party (1.0-2) unstable; urgency=low
 

Modified: trunk/keyanalyze/analyze.sh
===================================================================
--- trunk/keyanalyze/analyze.sh	2008-07-18 13:19:41 UTC (rev 389)
+++ trunk/keyanalyze/analyze.sh	2008-07-18 13:34:49 UTC (rev 390)
@@ -5,11 +5,7 @@
 
 # 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

Modified: trunk/keyanalyze/process_keys.1
===================================================================
--- trunk/keyanalyze/process_keys.1	2008-07-18 13:19:41 UTC (rev 389)
+++ trunk/keyanalyze/process_keys.1	2008-07-18 13:34:49 UTC (rev 390)
@@ -20,6 +20,11 @@
 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

Modified: trunk/keyanalyze/process_keys.c
===================================================================
--- trunk/keyanalyze/process_keys.c	2008-07-18 13:19:41 UTC (rev 389)
+++ trunk/keyanalyze/process_keys.c	2008-07-18 13:34:49 UTC (rev 390)
@@ -184,7 +184,7 @@
 
   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 @@
 
 	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 @@
       {
 	struct sig *sig = *lastsig = new_sig();
 	lastsig = &sig->next;
-	sprintf (sig->id, "%.16s", strtok (NULL, " \t\r\n"));
+	sprintf (sig->id, "%s", strtok (NULL, ":"));
       }
     }
   }




More information about the Pgp-tools-commit mailing list