From 3e2ab88ee2e488df1b674655f0038729a635aa52 Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Thu, 12 Apr 2001 13:49:09 +0000 Subject: New dpkg-deb function -t, stands for --fsys-tarfile --- libbb/deb_extract.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'libbb/deb_extract.c') diff --git a/libbb/deb_extract.c b/libbb/deb_extract.c index e982c14bb..d3e615305 100644 --- a/libbb/deb_extract.c +++ b/libbb/deb_extract.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #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); -- cgit v1.2.3