aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-05 06:04:11 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-05 06:04:11 +0000
commitfdefbbbe85b852ba6de361c8f53d025b09b9abbe (patch)
treec12bd937b7cb0e1168795af1d9778d4c93f77cb5
parente76c3b08e105147e3cef7e8d38d65da2fac6b2e1 (diff)
downloadbusybox-fdefbbbe85b852ba6de361c8f53d025b09b9abbe.tar.gz
dpkg_deb had not been updated for the new gunzip interface. Fix it.
-Erik
-rw-r--r--archival/dpkg_deb.c18
-rw-r--r--dpkg_deb.c18
2 files changed, 32 insertions, 4 deletions
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c
index c08438189..309f8d762 100644
--- a/archival/dpkg_deb.c
+++ b/archival/dpkg_deb.c
@@ -26,6 +26,10 @@
#include <stdlib.h>
#include "busybox.h"
+/* From gunzip.c */
+extern int gz_open(FILE *compressed_file, int *pid);
+extern void gz_close(int gunzip_pid);
+
typedef struct ar_headers_s {
char *name;
size_t size;
@@ -60,6 +64,8 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen
int extract_to_stdout = FALSE;
int srcFd = 0;
int status;
+ pid_t pid;
+ FILE *comp_file = NULL;
if (dpkg_deb_contents == (dpkg_deb_contents & optflags)) {
strcpy(ar_filename, "data.tar.gz");
@@ -99,7 +105,11 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen
ar_headers = ar_headers->next;
}
lseek(srcFd, ar_headers->offset, SEEK_SET);
- srcFd = tar_unzip_init(srcFd);
+ /* Uncompress the file */
+ comp_file = fdopen(srcFd, "r");
+ if ((srcFd = gz_open(comp_file, &pid)) == EXIT_FAILURE) {
+ error_msg_and_die("Couldnt unzip file");
+ }
if ( dir_name != NULL) {
if (is_directory(dir_name, TRUE, NULL)==FALSE) {
mkdir(dir_name, 0755);
@@ -108,7 +118,11 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen
error_msg_and_die("Cannot change to dir %s", dir_name);
}
}
- status = readTarFile(srcFd, extract_flag, list_flag, extract_to_stdout, verbose_flag, NULL, extract_list);
+ status = readTarFile(srcFd, extract_flag, list_flag,
+ extract_to_stdout, verbose_flag, NULL, extract_list);
+ close(srcFd);
+ gz_close(pid);
+ fclose(comp_file);
return status;
}
diff --git a/dpkg_deb.c b/dpkg_deb.c
index c08438189..309f8d762 100644
--- a/dpkg_deb.c
+++ b/dpkg_deb.c
@@ -26,6 +26,10 @@
#include <stdlib.h>
#include "busybox.h"
+/* From gunzip.c */
+extern int gz_open(FILE *compressed_file, int *pid);
+extern void gz_close(int gunzip_pid);
+
typedef struct ar_headers_s {
char *name;
size_t size;
@@ -60,6 +64,8 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen
int extract_to_stdout = FALSE;
int srcFd = 0;
int status;
+ pid_t pid;
+ FILE *comp_file = NULL;
if (dpkg_deb_contents == (dpkg_deb_contents & optflags)) {
strcpy(ar_filename, "data.tar.gz");
@@ -99,7 +105,11 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen
ar_headers = ar_headers->next;
}
lseek(srcFd, ar_headers->offset, SEEK_SET);
- srcFd = tar_unzip_init(srcFd);
+ /* Uncompress the file */
+ comp_file = fdopen(srcFd, "r");
+ if ((srcFd = gz_open(comp_file, &pid)) == EXIT_FAILURE) {
+ error_msg_and_die("Couldnt unzip file");
+ }
if ( dir_name != NULL) {
if (is_directory(dir_name, TRUE, NULL)==FALSE) {
mkdir(dir_name, 0755);
@@ -108,7 +118,11 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen
error_msg_and_die("Cannot change to dir %s", dir_name);
}
}
- status = readTarFile(srcFd, extract_flag, list_flag, extract_to_stdout, verbose_flag, NULL, extract_list);
+ status = readTarFile(srcFd, extract_flag, list_flag,
+ extract_to_stdout, verbose_flag, NULL, extract_list);
+ close(srcFd);
+ gz_close(pid);
+ fclose(comp_file);
return status;
}