diff options
author | Ron Yorston <rmy@pobox.com> | 2012-03-22 14:11:12 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2012-03-22 14:11:12 +0000 |
commit | 67758035a4fe040c6ac69b39d61bcd6bddd7b827 (patch) | |
tree | a4a1db7f54c16d12fabe2626b8f1e235cd694e9e /archival | |
parent | 811c449748d5bd0505f8510e5582892f94ac0cda (diff) | |
parent | b83c9704128dd106071184e4b00335a3b8486857 (diff) | |
download | busybox-w32-67758035a4fe040c6ac69b39d61bcd6bddd7b827.tar.gz busybox-w32-67758035a4fe040c6ac69b39d61bcd6bddd7b827.tar.bz2 busybox-w32-67758035a4fe040c6ac69b39d61bcd6bddd7b827.zip |
Merge commit 'b83c9704128dd106071184e4b00335a3b8486857' into merge
Diffstat (limited to 'archival')
-rw-r--r-- | archival/ar.c | 13 | ||||
-rw-r--r-- | archival/bbunzip.c | 76 | ||||
-rw-r--r-- | archival/bzip2.c | 10 | ||||
-rw-r--r-- | archival/dpkg.c | 28 | ||||
-rw-r--r-- | archival/dpkg_deb.c | 15 | ||||
-rw-r--r-- | archival/gzip.c | 20 | ||||
-rw-r--r-- | archival/lzop.c | 27 | ||||
-rw-r--r-- | archival/rpm.c | 13 | ||||
-rw-r--r-- | archival/rpm2cpio.c | 6 | ||||
-rw-r--r-- | archival/unzip.c | 13 |
10 files changed, 218 insertions, 3 deletions
diff --git a/archival/ar.c b/archival/ar.c index a2e3306ac..e7973af94 100644 --- a/archival/ar.c +++ b/archival/ar.c | |||
@@ -17,6 +17,17 @@ | |||
17 | * http://www.unix-systems.org/single_unix_specification_v2/xcu/ar.html | 17 | * http://www.unix-systems.org/single_unix_specification_v2/xcu/ar.html |
18 | */ | 18 | */ |
19 | 19 | ||
20 | //usage:#define ar_trivial_usage | ||
21 | //usage: "[-o] [-v] [-p] [-t] [-x] ARCHIVE FILES" | ||
22 | //usage:#define ar_full_usage "\n\n" | ||
23 | //usage: "Extract or list FILES from an ar archive\n" | ||
24 | //usage: "\nOptions:" | ||
25 | //usage: "\n -o Preserve original dates" | ||
26 | //usage: "\n -p Extract to stdout" | ||
27 | //usage: "\n -t List" | ||
28 | //usage: "\n -x Extract" | ||
29 | //usage: "\n -v Verbose" | ||
30 | |||
20 | #include "libbb.h" | 31 | #include "libbb.h" |
21 | #include "archive.h" | 32 | #include "archive.h" |
22 | #include "ar.h" | 33 | #include "ar.h" |
@@ -71,7 +82,7 @@ static void output_ar_header(archive_handle_t *handle) | |||
71 | } | 82 | } |
72 | 83 | ||
73 | /* | 84 | /* |
74 | * when replacing files in an existing archive, copy from the the | 85 | * when replacing files in an existing archive, copy from the |
75 | * original archive those files that are to be left intact | 86 | * original archive those files that are to be left intact |
76 | */ | 87 | */ |
77 | static void FAST_FUNC copy_data(archive_handle_t *handle) | 88 | static void FAST_FUNC copy_data(archive_handle_t *handle) |
diff --git a/archival/bbunzip.c b/archival/bbunzip.c index 85447cbfe..f1829db05 100644 --- a/archival/bbunzip.c +++ b/archival/bbunzip.c | |||
@@ -169,6 +169,15 @@ char* FAST_FUNC make_new_name_generic(char *filename, const char *expected_ext) | |||
169 | * | 169 | * |
170 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 170 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
171 | */ | 171 | */ |
172 | |||
173 | //usage:#define uncompress_trivial_usage | ||
174 | //usage: "[-cf] [FILE]..." | ||
175 | //usage:#define uncompress_full_usage "\n\n" | ||
176 | //usage: "Decompress .Z file[s]\n" | ||
177 | //usage: "\nOptions:" | ||
178 | //usage: "\n -c Write to stdout" | ||
179 | //usage: "\n -f Overwrite" | ||
180 | |||
172 | #if ENABLE_UNCOMPRESS | 181 | #if ENABLE_UNCOMPRESS |
173 | static | 182 | static |
174 | IF_DESKTOP(long long) int FAST_FUNC unpack_uncompress(unpack_info_t *info UNUSED_PARAM) | 183 | IF_DESKTOP(long long) int FAST_FUNC unpack_uncompress(unpack_info_t *info UNUSED_PARAM) |
@@ -220,6 +229,28 @@ int uncompress_main(int argc UNUSED_PARAM, char **argv) | |||
220 | * See the license_msg below and the file COPYING for the software license. | 229 | * See the license_msg below and the file COPYING for the software license. |
221 | * See the file algorithm.doc for the compression algorithms and file formats. | 230 | * See the file algorithm.doc for the compression algorithms and file formats. |
222 | */ | 231 | */ |
232 | |||
233 | //usage:#define gunzip_trivial_usage | ||
234 | //usage: "[-cft] [FILE]..." | ||
235 | //usage:#define gunzip_full_usage "\n\n" | ||
236 | //usage: "Decompress FILEs (or stdin)\n" | ||
237 | //usage: "\nOptions:" | ||
238 | //usage: "\n -c Write to stdout" | ||
239 | //usage: "\n -f Force" | ||
240 | //usage: "\n -t Test file integrity" | ||
241 | //usage: | ||
242 | //usage:#define gunzip_example_usage | ||
243 | //usage: "$ ls -la /tmp/BusyBox*\n" | ||
244 | //usage: "-rw-rw-r-- 1 andersen andersen 557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz\n" | ||
245 | //usage: "$ gunzip /tmp/BusyBox-0.43.tar.gz\n" | ||
246 | //usage: "$ ls -la /tmp/BusyBox*\n" | ||
247 | //usage: "-rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar\n" | ||
248 | //usage: | ||
249 | //usage:#define zcat_trivial_usage | ||
250 | //usage: "FILE" | ||
251 | //usage:#define zcat_full_usage "\n\n" | ||
252 | //usage: "Decompress to stdout" | ||
253 | |||
223 | #if ENABLE_GUNZIP | 254 | #if ENABLE_GUNZIP |
224 | static | 255 | static |
225 | char* FAST_FUNC make_new_name_gunzip(char *filename, const char *expected_ext UNUSED_PARAM) | 256 | char* FAST_FUNC make_new_name_gunzip(char *filename, const char *expected_ext UNUSED_PARAM) |
@@ -346,6 +377,51 @@ int bunzip2_main(int argc UNUSED_PARAM, char **argv) | |||
346 | * | 377 | * |
347 | * Licensed under GPLv2, see file LICENSE in this source tree. | 378 | * Licensed under GPLv2, see file LICENSE in this source tree. |
348 | */ | 379 | */ |
380 | |||
381 | //usage:#define unlzma_trivial_usage | ||
382 | //usage: "[-cf] [FILE]..." | ||
383 | //usage:#define unlzma_full_usage "\n\n" | ||
384 | //usage: "Decompress FILE (or stdin)\n" | ||
385 | //usage: "\nOptions:" | ||
386 | //usage: "\n -c Write to stdout" | ||
387 | //usage: "\n -f Force" | ||
388 | //usage: | ||
389 | //usage:#define lzma_trivial_usage | ||
390 | //usage: "-d [-cf] [FILE]..." | ||
391 | //usage:#define lzma_full_usage "\n\n" | ||
392 | //usage: "Decompress FILE (or stdin)\n" | ||
393 | //usage: "\nOptions:" | ||
394 | //usage: "\n -d Decompress" | ||
395 | //usage: "\n -c Write to stdout" | ||
396 | //usage: "\n -f Force" | ||
397 | //usage: | ||
398 | //usage:#define lzcat_trivial_usage | ||
399 | //usage: "FILE" | ||
400 | //usage:#define lzcat_full_usage "\n\n" | ||
401 | //usage: "Decompress to stdout" | ||
402 | //usage: | ||
403 | //usage:#define unxz_trivial_usage | ||
404 | //usage: "[-cf] [FILE]..." | ||
405 | //usage:#define unxz_full_usage "\n\n" | ||
406 | //usage: "Decompress FILE (or stdin)\n" | ||
407 | //usage: "\nOptions:" | ||
408 | //usage: "\n -c Write to stdout" | ||
409 | //usage: "\n -f Force" | ||
410 | //usage: | ||
411 | //usage:#define xz_trivial_usage | ||
412 | //usage: "-d [-cf] [FILE]..." | ||
413 | //usage:#define xz_full_usage "\n\n" | ||
414 | //usage: "Decompress FILE (or stdin)\n" | ||
415 | //usage: "\nOptions:" | ||
416 | //usage: "\n -d Decompress" | ||
417 | //usage: "\n -c Write to stdout" | ||
418 | //usage: "\n -f Force" | ||
419 | //usage: | ||
420 | //usage:#define xzcat_trivial_usage | ||
421 | //usage: "FILE" | ||
422 | //usage:#define xzcat_full_usage "\n\n" | ||
423 | //usage: "Decompress to stdout" | ||
424 | |||
349 | #if ENABLE_UNLZMA | 425 | #if ENABLE_UNLZMA |
350 | static | 426 | static |
351 | IF_DESKTOP(long long) int FAST_FUNC unpack_unlzma(unpack_info_t *info UNUSED_PARAM) | 427 | IF_DESKTOP(long long) int FAST_FUNC unpack_unlzma(unpack_info_t *info UNUSED_PARAM) |
diff --git a/archival/bzip2.c b/archival/bzip2.c index ab08ffc1a..cfaf5fe20 100644 --- a/archival/bzip2.c +++ b/archival/bzip2.c | |||
@@ -7,6 +7,16 @@ | |||
7 | * about bzip2 library code. | 7 | * about bzip2 library code. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | //usage:#define bzip2_trivial_usage | ||
11 | //usage: "[OPTIONS] [FILE]..." | ||
12 | //usage:#define bzip2_full_usage "\n\n" | ||
13 | //usage: "Compress FILEs (or stdin) with bzip2 algorithm\n" | ||
14 | //usage: "\nOptions:" | ||
15 | //usage: "\n -1..9 Compression level" | ||
16 | //usage: "\n -d Decompress" | ||
17 | //usage: "\n -c Write to stdout" | ||
18 | //usage: "\n -f Force" | ||
19 | |||
10 | #include "libbb.h" | 20 | #include "libbb.h" |
11 | #include "archive.h" | 21 | #include "archive.h" |
12 | 22 | ||
diff --git a/archival/dpkg.c b/archival/dpkg.c index c37ae3349..f8e349d09 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -28,6 +28,34 @@ | |||
28 | * | 28 | * |
29 | */ | 29 | */ |
30 | 30 | ||
31 | //usage:#define dpkg_trivial_usage | ||
32 | //usage: "[-ilCPru] [-F OPT] PACKAGE" | ||
33 | //usage:#define dpkg_full_usage "\n\n" | ||
34 | //usage: "Install, remove and manage Debian packages\n" | ||
35 | //usage: "\nOptions:" | ||
36 | //usage: IF_LONG_OPTS( | ||
37 | //usage: "\n -i,--install Install the package" | ||
38 | //usage: "\n -l,--list List of installed packages" | ||
39 | //usage: "\n --configure Configure an unpackaged package" | ||
40 | //usage: "\n -P,--purge Purge all files of a package" | ||
41 | //usage: "\n -r,--remove Remove all but the configuration files for a package" | ||
42 | //usage: "\n --unpack Unpack a package, but don't configure it" | ||
43 | //usage: "\n --force-depends Ignore dependency problems" | ||
44 | //usage: "\n --force-confnew Overwrite existing config files when installing" | ||
45 | //usage: "\n --force-confold Keep old config files when installing" | ||
46 | //usage: ) | ||
47 | //usage: IF_NOT_LONG_OPTS( | ||
48 | //usage: "\n -i Install the package" | ||
49 | //usage: "\n -l List of installed packages" | ||
50 | //usage: "\n -C Configure an unpackaged package" | ||
51 | //usage: "\n -P Purge all files of a package" | ||
52 | //usage: "\n -r Remove all but the configuration files for a package" | ||
53 | //usage: "\n -u Unpack a package, but don't configure it" | ||
54 | //usage: "\n -F depends Ignore dependency problems" | ||
55 | //usage: "\n -F confnew Overwrite existing config files when installing" | ||
56 | //usage: "\n -F confold Keep old config files when installing" | ||
57 | //usage: ) | ||
58 | |||
31 | #include "libbb.h" | 59 | #include "libbb.h" |
32 | #include <fnmatch.h> | 60 | #include <fnmatch.h> |
33 | #include "archive.h" | 61 | #include "archive.h" |
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c index aee7b4cf5..9e1e811ee 100644 --- a/archival/dpkg_deb.c +++ b/archival/dpkg_deb.c | |||
@@ -4,6 +4,21 @@ | |||
4 | * | 4 | * |
5 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 5 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
6 | */ | 6 | */ |
7 | |||
8 | //usage:#define dpkg_deb_trivial_usage | ||
9 | //usage: "[-cefxX] FILE [argument" | ||
10 | //usage:#define dpkg_deb_full_usage "\n\n" | ||
11 | //usage: "Perform actions on Debian packages (.debs)\n" | ||
12 | //usage: "\nOptions:" | ||
13 | //usage: "\n -c List contents of filesystem tree" | ||
14 | //usage: "\n -e Extract control files to [argument] directory" | ||
15 | //usage: "\n -f Display control field name starting with [argument]" | ||
16 | //usage: "\n -x Extract packages filesystem tree to directory" | ||
17 | //usage: "\n -X Verbose extract" | ||
18 | //usage: | ||
19 | //usage:#define dpkg_deb_example_usage | ||
20 | //usage: "$ dpkg-deb -X ./busybox_0.48-1_i386.deb /tmp\n" | ||
21 | |||
7 | #include "libbb.h" | 22 | #include "libbb.h" |
8 | #include "archive.h" | 23 | #include "archive.h" |
9 | 24 | ||
diff --git a/archival/gzip.c b/archival/gzip.c index feeddf58f..b2f9b2dc2 100644 --- a/archival/gzip.c +++ b/archival/gzip.c | |||
@@ -39,6 +39,22 @@ gzip: bogus: No such file or directory | |||
39 | aa: 85.1% -- replaced with aa.gz | 39 | aa: 85.1% -- replaced with aa.gz |
40 | */ | 40 | */ |
41 | 41 | ||
42 | //usage:#define gzip_trivial_usage | ||
43 | //usage: "[-cfd] [FILE]..." | ||
44 | //usage:#define gzip_full_usage "\n\n" | ||
45 | //usage: "Compress FILEs (or stdin)\n" | ||
46 | //usage: "\nOptions:" | ||
47 | //usage: "\n -d Decompress" | ||
48 | //usage: "\n -c Write to stdout" | ||
49 | //usage: "\n -f Force" | ||
50 | //usage: | ||
51 | //usage:#define gzip_example_usage | ||
52 | //usage: "$ ls -la /tmp/busybox*\n" | ||
53 | //usage: "-rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/busybox.tar\n" | ||
54 | //usage: "$ gzip /tmp/busybox.tar\n" | ||
55 | //usage: "$ ls -la /tmp/busybox*\n" | ||
56 | //usage: "-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n" | ||
57 | |||
42 | #include "libbb.h" | 58 | #include "libbb.h" |
43 | #include "archive.h" | 59 | #include "archive.h" |
44 | 60 | ||
@@ -1658,7 +1674,7 @@ static ulg flush_block(char *buf, ulg stored_len, int eof_) | |||
1658 | 1674 | ||
1659 | /* =========================================================================== | 1675 | /* =========================================================================== |
1660 | * Update a hash value with the given input byte | 1676 | * Update a hash value with the given input byte |
1661 | * IN assertion: all calls to to UPDATE_HASH are made with consecutive | 1677 | * IN assertion: all calls to UPDATE_HASH are made with consecutive |
1662 | * input characters, so that a running hash key can be computed from the | 1678 | * input characters, so that a running hash key can be computed from the |
1663 | * previous key instead of complete recalculation each time. | 1679 | * previous key instead of complete recalculation each time. |
1664 | */ | 1680 | */ |
@@ -1689,7 +1705,7 @@ static ulg flush_block(char *buf, ulg stored_len, int eof_) | |||
1689 | /* Insert string s in the dictionary and set match_head to the previous head | 1705 | /* Insert string s in the dictionary and set match_head to the previous head |
1690 | * of the hash chain (the most recent string with same hash key). Return | 1706 | * of the hash chain (the most recent string with same hash key). Return |
1691 | * the previous length of the hash chain. | 1707 | * the previous length of the hash chain. |
1692 | * IN assertion: all calls to to INSERT_STRING are made with consecutive | 1708 | * IN assertion: all calls to INSERT_STRING are made with consecutive |
1693 | * input characters and the first MIN_MATCH bytes of s are valid | 1709 | * input characters and the first MIN_MATCH bytes of s are valid |
1694 | * (except for the last MIN_MATCH-1 bytes of the input file). */ | 1710 | * (except for the last MIN_MATCH-1 bytes of the input file). */ |
1695 | #define INSERT_STRING(s, match_head) \ | 1711 | #define INSERT_STRING(s, match_head) \ |
diff --git a/archival/lzop.c b/archival/lzop.c index 62455c313..f4419910f 100644 --- a/archival/lzop.c +++ b/archival/lzop.c | |||
@@ -25,6 +25,33 @@ | |||
25 | "Minimalized" for busybox by Alain Knaff | 25 | "Minimalized" for busybox by Alain Knaff |
26 | */ | 26 | */ |
27 | 27 | ||
28 | //usage:#define lzop_trivial_usage | ||
29 | //usage: "[-cfvd123456789CF] [FILE]..." | ||
30 | //usage:#define lzop_full_usage "\n\n" | ||
31 | //usage: "Options:" | ||
32 | //usage: "\n -1..9 Compression level" | ||
33 | //usage: "\n -d Decompress" | ||
34 | //usage: "\n -c Write to stdout" | ||
35 | //usage: "\n -f Force" | ||
36 | //usage: "\n -v Verbose" | ||
37 | //usage: "\n -F Don't store or verify checksum" | ||
38 | //usage: "\n -C Also write checksum of compressed block" | ||
39 | //usage: | ||
40 | //usage:#define lzopcat_trivial_usage | ||
41 | //usage: "[-vCF] [FILE]..." | ||
42 | //usage:#define lzopcat_full_usage "\n\n" | ||
43 | //usage: " -v Verbose" | ||
44 | //usage: "\n -F Don't store or verify checksum" | ||
45 | //usage: | ||
46 | //usage:#define unlzop_trivial_usage | ||
47 | //usage: "[-cfvCF] [FILE]..." | ||
48 | //usage:#define unlzop_full_usage "\n\n" | ||
49 | //usage: "Options:" | ||
50 | //usage: "\n -c Write to stdout" | ||
51 | //usage: "\n -f Force" | ||
52 | //usage: "\n -v Verbose" | ||
53 | //usage: "\n -F Don't store or verify checksum" | ||
54 | |||
28 | #include "libbb.h" | 55 | #include "libbb.h" |
29 | #include "archive.h" | 56 | #include "archive.h" |
30 | #include "liblzo_interface.h" | 57 | #include "liblzo_interface.h" |
diff --git a/archival/rpm.c b/archival/rpm.c index 380226f9b..98a45d9cc 100644 --- a/archival/rpm.c +++ b/archival/rpm.c | |||
@@ -7,6 +7,19 @@ | |||
7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | //usage:#define rpm_trivial_usage | ||
11 | //usage: "-i PACKAGE.rpm; rpm -qp[ildc] PACKAGE.rpm" | ||
12 | //usage:#define rpm_full_usage "\n\n" | ||
13 | //usage: "Manipulate RPM packages\n" | ||
14 | //usage: "\nCommands:" | ||
15 | //usage: "\n -i Install package" | ||
16 | //usage: "\n -qp Query package" | ||
17 | //usage: "\nOptions:" | ||
18 | //usage: "\n -i Show information" | ||
19 | //usage: "\n -l List contents" | ||
20 | //usage: "\n -d List documents" | ||
21 | //usage: "\n -c List config files" | ||
22 | |||
10 | #include "libbb.h" | 23 | #include "libbb.h" |
11 | #include "archive.h" | 24 | #include "archive.h" |
12 | #include "rpm.h" | 25 | #include "rpm.h" |
diff --git a/archival/rpm2cpio.c b/archival/rpm2cpio.c index ce8cd2c2c..ff4a0d1b0 100644 --- a/archival/rpm2cpio.c +++ b/archival/rpm2cpio.c | |||
@@ -6,6 +6,12 @@ | |||
6 | * | 6 | * |
7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
8 | */ | 8 | */ |
9 | |||
10 | //usage:#define rpm2cpio_trivial_usage | ||
11 | //usage: "package.rpm" | ||
12 | //usage:#define rpm2cpio_full_usage "\n\n" | ||
13 | //usage: "Output a cpio archive of the rpm file" | ||
14 | |||
9 | #include "libbb.h" | 15 | #include "libbb.h" |
10 | #include "archive.h" | 16 | #include "archive.h" |
11 | #include "rpm.h" | 17 | #include "rpm.h" |
diff --git a/archival/unzip.c b/archival/unzip.c index 5d62c08cb..52b0a6414 100644 --- a/archival/unzip.c +++ b/archival/unzip.c | |||
@@ -19,6 +19,19 @@ | |||
19 | * Zip64 + other methods | 19 | * Zip64 + other methods |
20 | */ | 20 | */ |
21 | 21 | ||
22 | //usage:#define unzip_trivial_usage | ||
23 | //usage: "[-opts[modifiers]] FILE[.zip] [LIST] [-x XLIST] [-d DIR]" | ||
24 | //usage:#define unzip_full_usage "\n\n" | ||
25 | //usage: "Extract files from ZIP archives\n" | ||
26 | //usage: "\nOptions:" | ||
27 | //usage: "\n -l List archive contents (with -q for short form)" | ||
28 | //usage: "\n -n Never overwrite files (default)" | ||
29 | //usage: "\n -o Overwrite" | ||
30 | //usage: "\n -p Send output to stdout" | ||
31 | //usage: "\n -q Quiet" | ||
32 | //usage: "\n -x XLST Exclude these files" | ||
33 | //usage: "\n -d DIR Extract files into DIR" | ||
34 | |||
22 | #include "libbb.h" | 35 | #include "libbb.h" |
23 | #include "archive.h" | 36 | #include "archive.h" |
24 | 37 | ||