summaryrefslogtreecommitdiff
path: root/libbb/deb_extract.c
diff options
context:
space:
mode:
authorGlenn L McGrath2001-04-12 13:49:09 +0000
committerGlenn L McGrath2001-04-12 13:49:09 +0000
commit3e2ab88ee2e488df1b674655f0038729a635aa52 (patch)
tree40aecd08a39f0f1ad7074f2a1003ace79bb4c641 /libbb/deb_extract.c
parentc9cac5be236475e91af1865a2dae2c2af5f19fd6 (diff)
downloadbusybox-3e2ab88ee2e488df1b674655f0038729a635aa52.zip
busybox-3e2ab88ee2e488df1b674655f0038729a635aa52.tar.gz
New dpkg-deb function -t, stands for --fsys-tarfile
Diffstat (limited to 'libbb/deb_extract.c')
-rw-r--r--libbb/deb_extract.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/libbb/deb_extract.c b/libbb/deb_extract.c
index e982c14..d3e6153 100644
--- a/libbb/deb_extract.c
+++ b/libbb/deb_extract.c
@@ -26,6 +26,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
+#include <string.h>
#include <signal.h>
#include "libbb.h"
@@ -42,14 +43,9 @@ extern int deb_extract(const char *package_filename, int function, char *target_
case (extract_control):
ared_file = xstrdup("control.tar.gz");
break;
- case (extract_contents):
- case (extract_extract):
- case (extract_verbose_extract):
- case (extract_list):
+ default:
ared_file = xstrdup("data.tar.gz");
break;
- default:
- error_msg("Unknown extraction function");
}
/* open the debian package to be worked on */
@@ -71,9 +67,11 @@ extern int deb_extract(const char *package_filename, int function, char *target_
/* open a stream of decompressed data */
uncompressed_file = fdopen(gz_open(deb_file, &gunzip_pid), "r");
- /* get a list of all tar headers inside the .gz file */
- untar(uncompressed_file, function, target_dir);
-
+ if (function & extract_fsys_tarfile) {
+ copy_file_chunk(uncompressed_file, stdout, -1);
+ } else {
+ untar(uncompressed_file, function, target_dir);
+ }
/* we are deliberately terminating the child so we can safely ignore this */
gz_close(gunzip_pid);