diff options
-rw-r--r-- | debian/changelog | 3 | ||||
-rw-r--r-- | dpkg-deb/extract.c | 8 | ||||
-rw-r--r-- | man/dpkg-deb.1 | 8 |
3 files changed, 18 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog index ceff59e90..a5349310d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -72,6 +72,9 @@ dpkg (1.18.0) UNRELEASED; urgency=low an Architecture field. Regression introduced in dpkg 1.16.2. * Fix «dpkg --audit» to report missing and empty architecture fields. Regression introduced in dpkg 1.16.2. + * Add support to dpkg-deb for reading the archive from standard input, + except for --raw-extract which does not yet support it. Closes: #616614 + Based on a patch by Johannes Schauer <j.schauer@email.de>. [ Updated manpages translations ] * German (Helge Kreutzmann). diff --git a/dpkg-deb/extract.c b/dpkg-deb/extract.c index 3e814c9f8..70c2c0b12 100644 --- a/dpkg-deb/extract.c +++ b/dpkg-deb/extract.c @@ -123,7 +123,10 @@ extracthalf(const char *debar, const char *dir, bool header_done; enum compressor_type decompressor = COMPRESSOR_TYPE_GZIP; - arfd = open(debar, O_RDONLY); + if (strcmp(debar, "-") == 0) + arfd = STDIN_FILENO; + else + arfd = open(debar, O_RDONLY); if (arfd < 0) ohshite(_("failed to read archive `%.255s'"), debar); if (fstat(arfd, &stab)) @@ -475,6 +478,9 @@ do_raw_extract(const char *const *argv) if (debar == NULL) badusage(_("--%s needs .deb filename and directory arguments"), cipaction->olong); + else if (strcmp(debar, "-") == 0) + badusage(_("--%s does not support (yet) reading the .deb from standard input"), + cipaction->olong); dir = *argv++; if (dir == NULL) diff --git a/man/dpkg-deb.1 b/man/dpkg-deb.1 index 131fc15fb..832468769 100644 --- a/man/dpkg-deb.1 +++ b/man/dpkg-deb.1 @@ -43,6 +43,11 @@ with whatever options you want to pass to will spot that you wanted .B dpkg\-deb and run it for you. +.PP +For most commands taking an input archive argument, the archive can be +read from standard input if the archive name is given as a single minus +character (\fB\-\fP); otherwise lack of support will be documented in +their respective command description. . .SH COMMANDS .TP @@ -169,6 +174,9 @@ directory, and the control information files into a DEBIAN subdirectory of the specified directory (since dpkg 1.16.1). The target directory (but not its parents) will be created if necessary. + +The input archive is not (currently) processed sequentially, so reading +it from standard input (\fB-\fP) is \fBnot\fP supported. .TP .BR \-\-ctrl\-tarfile " \fIarchive\fP" Extracts the control data from a binary package and sends it to standard |