From ddd873fa8372173c5615c38ca1a333a487ab6cb6 Mon Sep 17 00:00:00 2001 From: myon Date: Fri, 18 Jul 2008 13:34:49 +0000 Subject: [PATCH] Add patch by Stephan Beyer to improve process_keys' input parsing, 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 | 4 +++- keyanalyze/analyze.sh | 6 +----- keyanalyze/process_keys.1 | 5 +++++ keyanalyze/process_keys.c | 12 ++++++++---- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 390e816..7c2cbbd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Fri, 18 Jul 2008 15:18:42 +0200 + -- Christoph Berg Fri, 18 Jul 2008 15:30:06 +0200 signing-party (1.0-2) unstable; urgency=low diff --git a/keyanalyze/analyze.sh b/keyanalyze/analyze.sh index b70d14b..65bc577 100755 --- a/keyanalyze/analyze.sh +++ b/keyanalyze/analyze.sh @@ -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 diff --git a/keyanalyze/process_keys.1 b/keyanalyze/process_keys.1 index 86c5edc..a6eff53 100644 --- a/keyanalyze/process_keys.1 +++ b/keyanalyze/process_keys.1 @@ -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 diff --git a/keyanalyze/process_keys.c b/keyanalyze/process_keys.c index acf5c89..1472a32 100644 --- a/keyanalyze/process_keys.c +++ b/keyanalyze/process_keys.c @@ -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, ":")); } } } -- 2.39.5