The following commit has been merged in the master branch:
commit 8561eeb48292a0495d13335d7f088fe66e8ea167
Author: Guillem Jover <guil...@debian.org>
Date:   Mon Jun 20 19:11:20 2011 +0200

    dpkg-deb: Add new -v, --verbose option
    
    Change --extract to honour --verbose and behave as --vextract.
    
    Closes: #293280

diff --git a/debian/changelog b/debian/changelog
index f195a80..255790c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -175,6 +175,8 @@ dpkg (1.16.1) UNRELEASED; urgency=low
     debian/rules.
   * Use the perl interpreter found by configure to call dpkg-architecture.pl
     in the m4 DPKG_ARCHITECTURE macro.
+  * Add new --verbose option to dpkg-deb and change --extract to honour it.
+    Closes: #293280
   * Fix possible segfault of dpkg in findbreakcycle(). LP: #733414
 
   [ Updated dpkg translations ]
diff --git a/dpkg-deb/dpkg-deb.h b/dpkg-deb/dpkg-deb.h
index 7ae4ccf..fb96742 100644
--- a/dpkg-deb/dpkg-deb.h
+++ b/dpkg-deb/dpkg-deb.h
@@ -31,6 +31,7 @@ action_func do_extract;
 action_func do_vextract;
 action_func do_fsystarfile;
 
+extern int opt_verbose;
 extern int debugflag, nocheckflag, oldformatflag;
 
 void extracthalf(const char *debar, const char *dir,
diff --git a/dpkg-deb/extract.c b/dpkg-deb/extract.c
index 2dde994..7e1ba96 100644
--- a/dpkg-deb/extract.c
+++ b/dpkg-deb/extract.c
@@ -377,11 +377,16 @@ do_control(const char *const *argv)
 int
 do_extract(const char *const *argv)
 {
-  return controlextractvextract(0, "xp", argv);
+  if (opt_verbose)
+    return controlextractvextract(0, "xpv", argv);
+  else
+    return controlextractvextract(0, "xp", argv);
 }
 
 int
 do_vextract(const char *const *argv)
 {
-  return controlextractvextract(0, "xpv", argv);
+  /* XXX: Backward compatibility. */
+  opt_verbose = 1;
+  return do_extract(argv);
 }
diff --git a/dpkg-deb/main.c b/dpkg-deb/main.c
index 49cf5e5..fb2fd06 100644
--- a/dpkg-deb/main.c
+++ b/dpkg-deb/main.c
@@ -96,6 +96,7 @@ usage(const struct cmdinfo *cip, const char *value)
   printf(_(
 "Options:\n"
 "  --showformat=<format>            Use alternative format for --show.\n"
+"  -v, --verbose                    Enable verbose output.\n"
 "  -D                               Enable debugging output.\n"
 "  --old, --new                     Select archive format.\n"
 "  --nocheck                        Suppress control file check (build bad\n"
@@ -130,6 +131,7 @@ static const char printforhelp[] =
      "Type dpkg --help for help about installing and deinstalling packages.");
 
 int debugflag=0, nocheckflag=0, oldformatflag=BUILDOLDPKGFORMAT;
+int opt_verbose = 0;
 struct compressor *compressor = &compressor_gzip;
 int compress_level = -1;
 
@@ -171,6 +173,7 @@ static const struct cmdinfo cmdinfos[]= {
   { "new",           0,   0, &oldformatflag, NULL,         NULL,          0 },
   { "old",           0,   0, &oldformatflag, NULL,         NULL,          1 },
   { "debug",         'D', 0, &debugflag,     NULL,         NULL,          1 },
+  { "verbose",       'v', 0, &opt_verbose,   NULL,         NULL,          1 },
   { "nocheck",       0,   0, &nocheckflag,   NULL,         NULL,          1 },
   { "compression",   'z', 1, NULL,           NULL,         set_compress_level 
},
   { "compress_type", 'Z', 1, NULL,           NULL,         setcompresstype  },
diff --git a/man/dpkg-deb.1 b/man/dpkg-deb.1
index 99cdc8e..4afc326 100644
--- a/man/dpkg-deb.1
+++ b/man/dpkg-deb.1
@@ -139,7 +139,9 @@ modified to match the contents of the package.
 .BR \-X ", " \-\-vextract " \fIarchive directory\fP"
 Is like
 .BR \-\-extract " (" \-x ")"
-but prints a listing of the files extracted as it goes.
+with
+.BR \-\-verbose " (" \-v ")"
+which prints a listing of the files extracted as it goes.
 .TP
 .BR \-\-fsys\-tarfile " \fIarchive\fP"
 Extracts the filesystem tree data from a binary package and sends it
@@ -213,6 +215,10 @@ Inhibits
 usual checks on the proposed contents of an archive. You can build
 any archive you want, no matter how broken, this way.
 .TP
+.BR \-v ", " \-\-verbose
+Enables verbose output. This currently only affects \fB\-\-extract\fP making
+it behave like \fB\-\-vextract\fP.
+.TP
 .BR \-D ", " \-\-debug
 Enables debugging output. This is not very interesting.
 .

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to