aboutsummaryrefslogtreecommitdiff
path: root/archival/bbunzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/bbunzip.c')
-rw-r--r--archival/bbunzip.c89
1 files changed, 36 insertions, 53 deletions
diff --git a/archival/bbunzip.c b/archival/bbunzip.c
index 1e3d6e586..f91dd25eb 100644
--- a/archival/bbunzip.c
+++ b/archival/bbunzip.c
@@ -239,11 +239,11 @@ char* FAST_FUNC make_new_name_generic(char *filename, const char *expected_ext)
239//usage: "\n -f Overwrite" 239//usage: "\n -f Overwrite"
240 240
241//config:config UNCOMPRESS 241//config:config UNCOMPRESS
242//config: bool "uncompress" 242//config: bool "uncompress (7.1 kb)"
243//config: default n # ancient 243//config: default n # ancient
244//config: help 244//config: help
245//config: uncompress is used to decompress archives created by compress. 245//config: uncompress is used to decompress archives created by compress.
246//config: Not much used anymore, replaced by gzip/gunzip. 246//config: Not much used anymore, replaced by gzip/gunzip.
247 247
248//applet:IF_UNCOMPRESS(APPLET(uncompress, BB_DIR_BIN, BB_SUID_DROP)) 248//applet:IF_UNCOMPRESS(APPLET(uncompress, BB_DIR_BIN, BB_SUID_DROP))
249//kbuild:lib-$(CONFIG_UNCOMPRESS) += bbunzip.o 249//kbuild:lib-$(CONFIG_UNCOMPRESS) += bbunzip.o
@@ -314,20 +314,20 @@ int uncompress_main(int argc UNUSED_PARAM, char **argv)
314//usage: "Decompress to stdout" 314//usage: "Decompress to stdout"
315 315
316//config:config GUNZIP 316//config:config GUNZIP
317//config: bool "gunzip" 317//config: bool "gunzip (12 kb)"
318//config: default y 318//config: default y
319//config: select FEATURE_GZIP_DECOMPRESS 319//config: select FEATURE_GZIP_DECOMPRESS
320//config: help 320//config: help
321//config: gunzip is used to decompress archives created by gzip. 321//config: gunzip is used to decompress archives created by gzip.
322//config: You can use the `-t' option to test the integrity of 322//config: You can use the `-t' option to test the integrity of
323//config: an archive, without decompressing it. 323//config: an archive, without decompressing it.
324//config: 324//config:
325//config:config ZCAT 325//config:config ZCAT
326//config: bool "zcat" 326//config: bool "zcat (25 kb)"
327//config: default y 327//config: default y
328//config: select FEATURE_GZIP_DECOMPRESS 328//config: select FEATURE_GZIP_DECOMPRESS
329//config: help 329//config: help
330//config: Alias to "gunzip -c". 330//config: Alias to "gunzip -c".
331//config: 331//config:
332//config:config FEATURE_GUNZIP_LONG_OPTIONS 332//config:config FEATURE_GUNZIP_LONG_OPTIONS
333//config: bool "Enable long options" 333//config: bool "Enable long options"
@@ -400,7 +400,7 @@ int gunzip_main(int argc UNUSED_PARAM, char **argv)
400 * Normally, "zcat" is just "gunzip -c". 400 * Normally, "zcat" is just "gunzip -c".
401 * But if seamless magic is enabled, then we are much more clever. 401 * But if seamless magic is enabled, then we are much more clever.
402 */ 402 */
403 if (ENABLE_ZCAT && applet_name[1] == 'c') 403 if (ENABLE_ZCAT && (!ENABLE_GUNZIP || applet_name[1] == 'c'))
404 option_mask32 |= OPT_STDOUT | SEAMLESS_MAGIC; 404 option_mask32 |= OPT_STDOUT | SEAMLESS_MAGIC;
405 405
406 return bbunpack(argv, unpack_gz_stream, make_new_name_gunzip, /*unused:*/ NULL); 406 return bbunpack(argv, unpack_gz_stream, make_new_name_gunzip, /*unused:*/ NULL);
@@ -427,25 +427,25 @@ int gunzip_main(int argc UNUSED_PARAM, char **argv)
427//usage: "Decompress to stdout" 427//usage: "Decompress to stdout"
428 428
429//config:config BUNZIP2 429//config:config BUNZIP2
430//config: bool "bunzip2" 430//config: bool "bunzip2 (8.8 kb)"
431//config: default y 431//config: default y
432//config: select FEATURE_BZIP2_DECOMPRESS 432//config: select FEATURE_BZIP2_DECOMPRESS
433//config: help 433//config: help
434//config: bunzip2 is a compression utility using the Burrows-Wheeler block 434//config: bunzip2 is a compression utility using the Burrows-Wheeler block
435//config: sorting text compression algorithm, and Huffman coding. Compression 435//config: sorting text compression algorithm, and Huffman coding. Compression
436//config: is generally considerably better than that achieved by more 436//config: is generally considerably better than that achieved by more
437//config: conventional LZ77/LZ78-based compressors, and approaches the 437//config: conventional LZ77/LZ78-based compressors, and approaches the
438//config: performance of the PPM family of statistical compressors. 438//config: performance of the PPM family of statistical compressors.
439//config: 439//config:
440//config: Unless you have a specific application which requires bunzip2, you 440//config: Unless you have a specific application which requires bunzip2, you
441//config: should probably say N here. 441//config: should probably say N here.
442//config: 442//config:
443//config:config BZCAT 443//config:config BZCAT
444//config: bool "bzcat" 444//config: bool "bzcat (8.8 kb)"
445//config: default y 445//config: default y
446//config: select FEATURE_BZIP2_DECOMPRESS 446//config: select FEATURE_BZIP2_DECOMPRESS
447//config: help 447//config: help
448//config: Alias to "bunzip2 -c". 448//config: Alias to "bunzip2 -c".
449 449
450//applet:IF_BUNZIP2(APPLET(bunzip2, BB_DIR_USR_BIN, BB_SUID_DROP)) 450//applet:IF_BUNZIP2(APPLET(bunzip2, BB_DIR_USR_BIN, BB_SUID_DROP))
451// APPLET_ODDNAME:name main location suid_type help 451// APPLET_ODDNAME:name main location suid_type help
@@ -456,7 +456,7 @@ int bunzip2_main(int argc UNUSED_PARAM, char **argv)
456{ 456{
457 getopt32(argv, "cfkvqdt"); 457 getopt32(argv, "cfkvqdt");
458 argv += optind; 458 argv += optind;
459 if (ENABLE_BZCAT && applet_name[2] == 'c') /* bzcat */ 459 if (ENABLE_BZCAT && (!ENABLE_BUNZIP2 || applet_name[2] == 'c')) /* bzcat */
460 option_mask32 |= OPT_STDOUT; 460 option_mask32 |= OPT_STDOUT;
461 461
462 return bbunpack(argv, unpack_bz2_stream, make_new_name_generic, "bz2"); 462 return bbunpack(argv, unpack_bz2_stream, make_new_name_generic, "bz2");
@@ -495,43 +495,26 @@ int bunzip2_main(int argc UNUSED_PARAM, char **argv)
495//usage: "Decompress to stdout" 495//usage: "Decompress to stdout"
496 496
497//config:config UNLZMA 497//config:config UNLZMA
498//config: bool "unlzma" 498//config: bool "unlzma (8.6 kb)"
499//config: default y 499//config: default y
500//config: help 500//config: help
501//config: unlzma is a compression utility using the Lempel-Ziv-Markov chain 501//config: unlzma is a compression utility using the Lempel-Ziv-Markov chain
502//config: compression algorithm, and range coding. Compression 502//config: compression algorithm, and range coding. Compression
503//config: is generally considerably better than that achieved by the bzip2 503//config: is generally considerably better than that achieved by the bzip2
504//config: compressors. 504//config: compressors.
505//config:
506//config: The BusyBox unlzma applet is limited to decompression only.
507//config: On an x86 system, this applet adds about 4K.
508//config: 505//config:
509//config:config LZCAT 506//config:config LZCAT
510//config: bool "lzcat" 507//config: bool "lzcat (8.5 kb)"
511//config: default y 508//config: default y
512//config: help 509//config: help
513//config: unlzma is a compression utility using the Lempel-Ziv-Markov chain 510//config: Alias to "unlzma -c".
514//config: compression algorithm, and range coding. Compression
515//config: is generally considerably better than that achieved by the bzip2
516//config: compressors.
517//config:
518//config: The BusyBox unlzma applet is limited to decompression only.
519//config: On an x86 system, this applet adds about 4K.
520//config: 511//config:
521//config:config LZMA 512//config:config LZMA
522//config: bool "lzma -d" 513//config: bool "lzma -d"
523//config: default y 514//config: default y
524//config: help 515//config: help
525//config: Enable this option if you want commands like "lzma -d" to work. 516//config: Enable this option if you want commands like "lzma -d" to work.
526//config: IOW: you'll get lzma applet, but it will always require -d option. 517//config: IOW: you'll get lzma applet, but it will always require -d option.
527//config:
528//config:config FEATURE_LZMA_FAST
529//config: bool "Optimize for speed"
530//config: default n
531//config: depends on UNLZMA || LZCAT || LZMA
532//config: help
533//config: This option reduces decompression time by about 25% at the cost of
534//config: a 1K bigger binary.
535 518
536//applet:IF_UNLZMA(APPLET(unlzma, BB_DIR_USR_BIN, BB_SUID_DROP)) 519//applet:IF_UNLZMA(APPLET(unlzma, BB_DIR_USR_BIN, BB_SUID_DROP))
537// APPLET_ODDNAME:name main location suid_type help 520// APPLET_ODDNAME:name main location suid_type help
@@ -583,23 +566,23 @@ int unlzma_main(int argc UNUSED_PARAM, char **argv)
583//usage: "Decompress to stdout" 566//usage: "Decompress to stdout"
584 567
585//config:config UNXZ 568//config:config UNXZ
586//config: bool "unxz" 569//config: bool "unxz (13 kb)"
587//config: default y 570//config: default y
588//config: help 571//config: help
589//config: unxz is a unlzma successor. 572//config: unxz is a unlzma successor.
590//config: 573//config:
591//config:config XZCAT 574//config:config XZCAT
592//config: bool "xzcat" 575//config: bool "xzcat (13 kb)"
593//config: default y 576//config: default y
594//config: help 577//config: help
595//config: Alias to "unxz -c". 578//config: Alias to "unxz -c".
596//config: 579//config:
597//config:config XZ 580//config:config XZ
598//config: bool "xz -d" 581//config: bool "xz -d"
599//config: default y 582//config: default y
600//config: help 583//config: help
601//config: Enable this option if you want commands like "xz -d" to work. 584//config: Enable this option if you want commands like "xz -d" to work.
602//config: IOW: you'll get xz applet, but it will always require -d option. 585//config: IOW: you'll get xz applet, but it will always require -d option.
603 586
604//applet:IF_UNXZ(APPLET(unxz, BB_DIR_USR_BIN, BB_SUID_DROP)) 587//applet:IF_UNXZ(APPLET(unxz, BB_DIR_USR_BIN, BB_SUID_DROP))
605// APPLET_ODDNAME:name main location suid_type help 588// APPLET_ODDNAME:name main location suid_type help