[git] GnuPG - branch, master, updated. gnupg-2.1.0-beta442-8-gd8314e3

by Werner Koch cvs at cvs.gnupg.org
Thu Jun 12 15:04:25 CEST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  d8314e31c58ea0827d0e2361dabcdf869ab08fce (commit)
      from  6eeb31abee82cb2016bf054cd302af64f6dfdc2e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d8314e31c58ea0827d0e2361dabcdf869ab08fce
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Jun 12 14:41:40 2014 +0200

    gpg: Improve the output of --list-packets
    
    * g10/parse-packet.c (parse): Print packet meta info in list mode.
    --
    
    In particular having the file offset of the packets is often useful.

diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index 26ca038..28f9016 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -403,11 +403,18 @@ parse (IOBUF inp, PACKET * pkt, int onlykeypkts, off_t * retpos,
   int hdrlen;
   int new_ctb = 0, partial = 0;
   int with_uid = (onlykeypkts == 2);
+  off_t pos;
 
   *skip = 0;
   assert (!pkt->pkt.generic);
-  if (retpos)
-    *retpos = iobuf_tell (inp);
+  if (retpos || list_mode)
+    {
+      pos = iobuf_tell (inp);
+      if (retpos)
+        *retpos = pos;
+    }
+  else
+    pos = 0; /* (silence compiler warning) */
 
   if ((ctb = iobuf_get (inp)) == -1)
     {
@@ -559,6 +566,12 @@ parse (IOBUF inp, PACKET * pkt, int onlykeypkts, off_t * retpos,
 #endif
     }
 
+  if (list_mode)
+    es_fprintf (listfp, "# off=%lu ctb=%02x tag=%d hlen=%d plen=%lu%s%s\n",
+                (unsigned long)pos, ctb, pkttype, hdrlen, pktlen,
+                partial? " partial":"",
+                new_ctb? " new-ctb":"");
+
   pkt->pkttype = pkttype;
   rc = G10ERR_UNKNOWN_PACKET;	/* default error */
   switch (pkttype)

-----------------------------------------------------------------------

Summary of changes:
 g10/parse-packet.c |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list