summaryrefslogtreecommitdiffstats
path: root/tools/busybox-patches/bzip2-payload.diff
diff options
context:
space:
mode:
Diffstat (limited to 'tools/busybox-patches/bzip2-payload.diff')
-rw-r--r--tools/busybox-patches/bzip2-payload.diff70
1 files changed, 34 insertions, 36 deletions
diff --git a/tools/busybox-patches/bzip2-payload.diff b/tools/busybox-patches/bzip2-payload.diff
index be2bb883..65863ad9 100644
--- a/tools/busybox-patches/bzip2-payload.diff
+++ b/tools/busybox-patches/bzip2-payload.diff
@@ -4,71 +4,69 @@ URL: http://www.busybox.net/lists/busybox/2004-May/011669.html
CVS: http://www.busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/patches/rpm2cpio_bzip2.patch?rev=9001
BugID: 1141
-Index: busybox-1.2.2/archival/Config.in
+Index: busybox-1.3.1/archival/Config.in
===================================================================
---- busybox-1.2.2.orig/archival/Config.in
-+++ busybox-1.2.2/archival/Config.in
-@@ -127,6 +127,14 @@ config CONFIG_RPM2CPIO
+--- busybox-1.3.1.orig/archival/Config.in
++++ busybox-1.3.1/archival/Config.in
+@@ -127,6 +127,14 @@ config RPM2CPIO
help
Converts an RPM file into a CPIO archive.
-+config CONFIG_FEATURE_RPM2CPIO_BZIP2
++config FEATURE_RPM2CPIO_BZIP2
+ bool " Support bzip2 decompression"
+ default n
-+ depends on CONFIG_RPM2CPIO
++ depends on RPM2CPIO
+ help
+ If you enable this option you'll be able to extract
+ rpms compressed with bzip2.
+
- config CONFIG_RPM
+ config RPM
bool "rpm"
default n
-Index: busybox-1.2.2/archival/libunarchive/Makefile.in
+Index: busybox-1.3.1/archival/libunarchive/Kbuild
===================================================================
---- busybox-1.2.2.orig/archival/libunarchive/Makefile.in
-+++ busybox-1.2.2/archival/libunarchive/Makefile.in
-@@ -59,6 +59,7 @@ LIBUNARCHIVE-$(CONFIG_FEATURE_DEB_TAR_LZ
- LIBUNARCHIVE-$(CONFIG_GUNZIP) += $(GUNZIP_FILES)
- LIBUNARCHIVE-$(CONFIG_FEATURE_GUNZIP_UNCOMPRESS) += decompress_uncompress.o
- LIBUNARCHIVE-$(CONFIG_RPM2CPIO) += $(GUNZIP_FILES) get_header_cpio.o
-+LIBUNARCHIVE-$(CONFIG_FEATURE_RPM2CPIO_BZIP2) += decompress_bunzip2.o
- LIBUNARCHIVE-$(CONFIG_RPM) += $(GUNZIP_FILES) get_header_cpio.o
- LIBUNARCHIVE-$(CONFIG_TAR) += get_header_tar.o
- LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_BZIP2) += decompress_bunzip2.o get_header_tar_bz2.o
-Index: busybox-1.2.2/archival/rpm2cpio.c
+--- busybox-1.3.1.orig/archival/libunarchive/Kbuild
++++ busybox-1.3.1/archival/libunarchive/Kbuild
+@@ -48,6 +48,7 @@ lib-$(CONFIG_FEATURE_DEB_TAR_LZMA) += de
+ lib-$(CONFIG_GUNZIP) += $(GUNZIP_FILES)
+ lib-$(CONFIG_FEATURE_GUNZIP_UNCOMPRESS) += decompress_uncompress.o
+ lib-$(CONFIG_RPM2CPIO) += $(GUNZIP_FILES) get_header_cpio.o
++lib-$(CONFIG_FEATURE_RPM2CPIO_BZIP2) += $(GUNZIP_FILES) decompress_bunzip2.o
+ lib-$(CONFIG_RPM) += $(GUNZIP_FILES) get_header_cpio.o
+ lib-$(CONFIG_TAR) += get_header_tar.o
+ lib-$(CONFIG_FEATURE_TAR_BZIP2) += decompress_bunzip2.o get_header_tar_bz2.o
+Index: busybox-1.3.1/archival/rpm2cpio.c
===================================================================
---- busybox-1.2.2.orig/archival/rpm2cpio.c
-+++ busybox-1.2.2/archival/rpm2cpio.c
-@@ -91,15 +91,27 @@ int rpm2cpio_main(int argc, char **argv)
+--- busybox-1.3.1.orig/archival/rpm2cpio.c
++++ busybox-1.3.1/archival/rpm2cpio.c
+@@ -74,14 +74,24 @@ int rpm2cpio_main(int argc, char **argv)
skip_header(rpm_fd);
- bb_xread_all(rpm_fd, &magic, 2);
+ xread(rpm_fd, &magic, 2);
- if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
-- bb_error_msg_and_die("Invalid gzip magic");
-+ if ((magic[0] == 0x1f) || (magic[1] == 0x8b)) {
+- bb_error_msg_and_die("invalid gzip magic");
++ if ((magic[0] == 0x1f) && (magic[1] == 0x8b)) {
+ check_header_gzip(rpm_fd);
-+ if (inflate_gunzip(rpm_fd, fileno(stdout)) != 0)
-+ bb_error_msg("Error inflating (gzip)");
++ if (inflate_gunzip(rpm_fd, STDOUT_FILENO) < 0) {
++ bb_error_msg("error inflating (gzip)");
++ }
}
-
+-
- check_header_gzip(rpm_fd);
-- if (inflate_gunzip(rpm_fd, STDOUT_FILENO) != 0) {
-- bb_error_msg("Error inflating");
+- if (inflate_gunzip(rpm_fd, STDOUT_FILENO) < 0) {
+- bb_error_msg("error inflating");
+ else if ((magic[0] == 'B') && (magic[1] == 'Z')) {
+#ifdef CONFIG_FEATURE_RPM2CPIO_BZIP2
+ /* return to position before magic (eek..!) */
+ lseek(rpm_fd, -2, SEEK_CUR);
-+ if(uncompressStream(rpm_fd, fileno(stdout)) != 0)
-+ bb_error_msg("Error inflating (bzip2)");
++ if (uncompressStream(rpm_fd, fileno(stdout)) != 0)
++ bb_error_msg("error inflating (bzip2)");
+#else
+ bb_error_msg_and_die("bzip2 not supported");
+#endif
}
-
+ else
+ bb_error_msg_and_die("not gzip or bzip2 compressed");
-+
-+
+
close(rpm_fd);
- return 0;