svn commit: trunk/busybox/archival

vda at busybox.net vda at busybox.net
Sun Mar 30 13:11:48 UTC 2008


Author: vda
Date: 2008-03-30 06:11:47 -0700 (Sun, 30 Mar 2008)
New Revision: 21578

Log:
g[un]zip: accept and ignore -n (needed for kernel compile)



Modified:
   trunk/busybox/archival/bbunzip.c
   trunk/busybox/archival/gzip.c


Changeset:
Modified: trunk/busybox/archival/bbunzip.c
===================================================================
--- trunk/busybox/archival/bbunzip.c	2008-03-30 08:12:22 UTC (rev 21577)
+++ trunk/busybox/archival/bbunzip.c	2008-03-30 13:11:47 UTC (rev 21578)
@@ -256,10 +256,24 @@
 	return status;
 }
 
+/*
+ * Linux kernel build uses gzip -d -n. We accept and ignore it.
+ * Man page says:
+ * -n --no-name
+ * gzip: do not save the original file name and time stamp.
+ * (The original name is always saved if the name had to be truncated.)
+ * gunzip: do not restore the original file name/time even if present
+ * (remove only the gzip suffix from the compressed file name).
+ * This option is the default when decompressing.
+ * -N --name
+ * gzip: always save the original file name and time stamp (this is the default)
+ * gunzip: restore the original file name and time stamp if present.
+ */
+
 int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 int gunzip_main(int argc ATTRIBUTE_UNUSED, char **argv)
 {
-	getopt32(argv, "cfvdt");
+	getopt32(argv, "cfvdtn");
 	argv += optind;
 	/* if called as zcat */
 	if (applet_name[1] == 'c')

Modified: trunk/busybox/archival/gzip.c
===================================================================
--- trunk/busybox/archival/gzip.c	2008-03-30 08:12:22 UTC (rev 21577)
+++ trunk/busybox/archival/gzip.c	2008-03-30 13:11:47 UTC (rev 21578)
@@ -2025,6 +2025,20 @@
 	return 0;
 }
 
+/*
+ * Linux kernel build uses gzip -d -n. We accept and ignore it.
+ * Man page says:
+ * -n --no-name
+ * gzip: do not save the original file name and time stamp.
+ * (The original name is always saved if the name had to be truncated.)
+ * gunzip: do not restore the original file name/time even if present
+ * (remove only the gzip suffix from the compressed file name).
+ * This option is the default when decompressing.
+ * -N --name
+ * gzip: always save the original file name and time stamp (this is the default)
+ * gunzip: restore the original file name and time stamp if present.
+ */
+
 int gzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 #if ENABLE_GUNZIP
 int gzip_main(int argc, char **argv)
@@ -2035,7 +2049,7 @@
 	unsigned opt;
 
 	/* Must match bbunzip's constants OPT_STDOUT, OPT_FORCE! */
-	opt = getopt32(argv, "cfv" USE_GUNZIP("d") "q123456789" );
+	opt = getopt32(argv, "cfv" USE_GUNZIP("d") "q123456789n" );
 #if ENABLE_GUNZIP /* gunzip_main may not be visible... */
 	if (opt & 0x8) // -d
 		return gunzip_main(argc, argv);




More information about the busybox-cvs mailing list