diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-04-05 06:04:11 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-04-05 06:04:11 +0000 |
commit | fdefbbbe85b852ba6de361c8f53d025b09b9abbe (patch) | |
tree | c12bd937b7cb0e1168795af1d9778d4c93f77cb5 | |
parent | e76c3b08e105147e3cef7e8d38d65da2fac6b2e1 (diff) | |
download | busybox-w32-fdefbbbe85b852ba6de361c8f53d025b09b9abbe.tar.gz busybox-w32-fdefbbbe85b852ba6de361c8f53d025b09b9abbe.tar.bz2 busybox-w32-fdefbbbe85b852ba6de361c8f53d025b09b9abbe.zip |
dpkg_deb had not been updated for the new gunzip interface. Fix it.
-Erik
-rw-r--r-- | archival/dpkg_deb.c | 18 | ||||
-rw-r--r-- | dpkg_deb.c | 18 |
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 @@ | |||
26 | #include <stdlib.h> | 26 | #include <stdlib.h> |
27 | #include "busybox.h" | 27 | #include "busybox.h" |
28 | 28 | ||
29 | /* From gunzip.c */ | ||
30 | extern int gz_open(FILE *compressed_file, int *pid); | ||
31 | extern void gz_close(int gunzip_pid); | ||
32 | |||
29 | typedef struct ar_headers_s { | 33 | typedef struct ar_headers_s { |
30 | char *name; | 34 | char *name; |
31 | size_t size; | 35 | size_t size; |
@@ -60,6 +64,8 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen | |||
60 | int extract_to_stdout = FALSE; | 64 | int extract_to_stdout = FALSE; |
61 | int srcFd = 0; | 65 | int srcFd = 0; |
62 | int status; | 66 | int status; |
67 | pid_t pid; | ||
68 | FILE *comp_file = NULL; | ||
63 | 69 | ||
64 | if (dpkg_deb_contents == (dpkg_deb_contents & optflags)) { | 70 | if (dpkg_deb_contents == (dpkg_deb_contents & optflags)) { |
65 | strcpy(ar_filename, "data.tar.gz"); | 71 | strcpy(ar_filename, "data.tar.gz"); |
@@ -99,7 +105,11 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen | |||
99 | ar_headers = ar_headers->next; | 105 | ar_headers = ar_headers->next; |
100 | } | 106 | } |
101 | lseek(srcFd, ar_headers->offset, SEEK_SET); | 107 | lseek(srcFd, ar_headers->offset, SEEK_SET); |
102 | srcFd = tar_unzip_init(srcFd); | 108 | /* Uncompress the file */ |
109 | comp_file = fdopen(srcFd, "r"); | ||
110 | if ((srcFd = gz_open(comp_file, &pid)) == EXIT_FAILURE) { | ||
111 | error_msg_and_die("Couldnt unzip file"); | ||
112 | } | ||
103 | if ( dir_name != NULL) { | 113 | if ( dir_name != NULL) { |
104 | if (is_directory(dir_name, TRUE, NULL)==FALSE) { | 114 | if (is_directory(dir_name, TRUE, NULL)==FALSE) { |
105 | mkdir(dir_name, 0755); | 115 | mkdir(dir_name, 0755); |
@@ -108,7 +118,11 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen | |||
108 | error_msg_and_die("Cannot change to dir %s", dir_name); | 118 | error_msg_and_die("Cannot change to dir %s", dir_name); |
109 | } | 119 | } |
110 | } | 120 | } |
111 | status = readTarFile(srcFd, extract_flag, list_flag, extract_to_stdout, verbose_flag, NULL, extract_list); | 121 | status = readTarFile(srcFd, extract_flag, list_flag, |
122 | extract_to_stdout, verbose_flag, NULL, extract_list); | ||
123 | close(srcFd); | ||
124 | gz_close(pid); | ||
125 | fclose(comp_file); | ||
112 | 126 | ||
113 | return status; | 127 | return status; |
114 | } | 128 | } |
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 @@ | |||
26 | #include <stdlib.h> | 26 | #include <stdlib.h> |
27 | #include "busybox.h" | 27 | #include "busybox.h" |
28 | 28 | ||
29 | /* From gunzip.c */ | ||
30 | extern int gz_open(FILE *compressed_file, int *pid); | ||
31 | extern void gz_close(int gunzip_pid); | ||
32 | |||
29 | typedef struct ar_headers_s { | 33 | typedef struct ar_headers_s { |
30 | char *name; | 34 | char *name; |
31 | size_t size; | 35 | size_t size; |
@@ -60,6 +64,8 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen | |||
60 | int extract_to_stdout = FALSE; | 64 | int extract_to_stdout = FALSE; |
61 | int srcFd = 0; | 65 | int srcFd = 0; |
62 | int status; | 66 | int status; |
67 | pid_t pid; | ||
68 | FILE *comp_file = NULL; | ||
63 | 69 | ||
64 | if (dpkg_deb_contents == (dpkg_deb_contents & optflags)) { | 70 | if (dpkg_deb_contents == (dpkg_deb_contents & optflags)) { |
65 | strcpy(ar_filename, "data.tar.gz"); | 71 | strcpy(ar_filename, "data.tar.gz"); |
@@ -99,7 +105,11 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen | |||
99 | ar_headers = ar_headers->next; | 105 | ar_headers = ar_headers->next; |
100 | } | 106 | } |
101 | lseek(srcFd, ar_headers->offset, SEEK_SET); | 107 | lseek(srcFd, ar_headers->offset, SEEK_SET); |
102 | srcFd = tar_unzip_init(srcFd); | 108 | /* Uncompress the file */ |
109 | comp_file = fdopen(srcFd, "r"); | ||
110 | if ((srcFd = gz_open(comp_file, &pid)) == EXIT_FAILURE) { | ||
111 | error_msg_and_die("Couldnt unzip file"); | ||
112 | } | ||
103 | if ( dir_name != NULL) { | 113 | if ( dir_name != NULL) { |
104 | if (is_directory(dir_name, TRUE, NULL)==FALSE) { | 114 | if (is_directory(dir_name, TRUE, NULL)==FALSE) { |
105 | mkdir(dir_name, 0755); | 115 | mkdir(dir_name, 0755); |
@@ -108,7 +118,11 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen | |||
108 | error_msg_and_die("Cannot change to dir %s", dir_name); | 118 | error_msg_and_die("Cannot change to dir %s", dir_name); |
109 | } | 119 | } |
110 | } | 120 | } |
111 | status = readTarFile(srcFd, extract_flag, list_flag, extract_to_stdout, verbose_flag, NULL, extract_list); | 121 | status = readTarFile(srcFd, extract_flag, list_flag, |
122 | extract_to_stdout, verbose_flag, NULL, extract_list); | ||
123 | close(srcFd); | ||
124 | gz_close(pid); | ||
125 | fclose(comp_file); | ||
112 | 126 | ||
113 | return status; | 127 | return status; |
114 | } | 128 | } |