aboutsummaryrefslogtreecommitdiff
path: root/archival/tar.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* randomconfig fixesDenys Vlasenko2014-12-221-5/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: fix "tar -cJ" ignoring -J option. closes 7706Denys Vlasenko2014-12-111-38/+28
| | | | | | | | | function old new delta tar_main 895 938 +43 vfork_compressor 206 191 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 43/-15) Total: 28 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libarchive: add capability to unpack to mem.bufferDenys Vlasenko2014-12-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The performance and number of processes for a "depmod -a" with gzipped modules was abysmal. This patch adds a code path without fork, benefiting all users of xmalloc_open_zipped_read_close. "modinfo radeon.ko.gz", a single-file reader, got 30% faster. "depmod -a", which used to fork over 800 times, got 20% faster. Heavily based on a patch by Lauri Kasanen <curaga@operamail.com> function old new delta setup_transformer_on_fd - 159 +159 transformer_write - 122 +122 fork_transformer - 112 +112 xmalloc_open_zipped_read_close 63 118 +55 read_bunzip 1866 1896 +30 xtransformer_write - 19 +19 unzip_main 2449 2462 +13 bbunpack 755 766 +11 unpack_lzma_stream 2717 2723 +6 unpack_xz_stream 2393 2397 +4 unpack_Z_stream 1173 1175 +2 inflate_unzip 111 105 -6 check_signature16 70 63 -7 unpack_bz2_stream 359 349 -10 unpack_unxz 12 - -12 unpack_unlzma 12 - -12 unpack_uncompress 12 - -12 unpack_gunzip 12 - -12 unpack_bunzip2 12 - -12 open_transformer 106 92 -14 inflate_unzip_internal 1945 1916 -29 unpack_gz_stream 693 655 -38 open_zipped 89 47 -42 setup_unzip_on_fd 142 53 -89 ------------------------------------------------------------------------------ (add/remove: 4/5 grow/shrink: 7/8 up/down: 533/-295) Total: 238 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Rename transformer_aux_data_t -> transformer_state_tDenys Vlasenko2014-12-071-1/+1
| | | | | | No code changes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* zcat: complain if input is not compressedDenys Vlasenko2014-02-021-1/+1
| | | | | | | | | | | | | | | | | | function old new delta buffer_fill_and_print 178 191 +13 varvalue 735 743 +8 bbunpack 747 755 +8 open_zipped 85 89 +4 xmalloc_open_zipped_read_close 61 63 +2 get_addr_1 240 242 +2 fbsplash_main 1228 1230 +2 pstree_main 322 321 -1 builtin_type 121 119 -2 do_load 954 926 -28 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 7/3 up/down: 39/-31) Total: 8 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: prevent empty file to be treated as valid tarballDenys Vlasenko2013-11-191-3/+10
| | | | | | | function old new delta tar_main 879 895 +16 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* archival/*: move "config:" snippets into .c filesDenys Vlasenko2013-11-141-1/+100
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* archival/*: move "applet:" snippets into .c filesDenys Vlasenko2013-11-141-0/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* archival/*: move "kbuild:" snippets into .c filesDenys Vlasenko2013-11-141-0/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: fix tar -T to add entries in the exact order as the input listSASAKI Suguru2013-08-151-3/+1
| | | | | | | | | | | | This fixes tar to order files in tarball correctly in this case: $ touch 1 2 3; echo -e '1\n2\n3' | tar -T- -c | tar t 1 2 3 Signed-off-by: SASAKI Suguru <suguru@sonik.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: change execl sentinels from NULL to (char*)0Rich Felker2013-06-301-1/+1
| | | | | Signed-off-by: Rich Felker <dalias@aerifal.cx> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixes. no code changesDenys Vlasenko2013-01-141-7/+7
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: support -J, --xz explicit compression optionBoris Reisig2012-05-241-2/+15
| | | | | | | | | | function old new delta tar_main 868 881 +13 tar_longopts 285 290 +5 packed_usage 29267 29270 +3 Signed-off-by: Boris Reisig <boris@boris.ca> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: implement --no-recursionNatanael Copa2012-05-181-7/+12
| | | | | | | | | | | | | | | | function old new delta tar_longopts 259 274 +15 .rodata 5757 5772 +15 tar_main 1038 1052 +14 writeTarFile 362 353 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 44/-9) Total: 35 bytes text data bss dec hex filename 81457 1706 8344 91507 16573 busybox_old 81477 1706 8344 91527 16587 busybox_unstripped Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar,rpm2cpio: check that child decompressor did not error outDenys Vlasenko2012-03-061-31/+7
| | | | | | | | | | | | | function old new delta check_errors_in_children - 57 +57 tar_main 833 848 +15 get_header_tar 1720 1733 +13 rpm2cpio_main 147 140 -7 handle_SIGCHLD 41 - -41 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 2/1 up/down: 85/-48) Total: 37 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* update seamless uncompression codeDenys Vlasenko2012-03-061-40/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes "tar tf hello_world.txz" work without adding special-casing for ".txz" extension. It also removes ever-growing magic checking code in rpm2cpio and get_header_tar - we reuse one which lives in setup_unzip_on_fd. function old new delta unpack_gz_stream 7 566 +559 check_signature16 - 70 +70 setup_unzip_on_fd 99 142 +43 handle_SIGCHLD - 41 +41 unpack_bz2_stream 342 376 +34 unzip_main 2352 2385 +33 bbunpack 503 533 +30 open_transformer 74 102 +28 unpack_Z_stream 1278 1304 +26 unpack_gunzip 101 123 +22 init_transformer_aux_data - 18 +18 unpack_xz_stream 2388 2402 +14 open_zipped 131 141 +10 rpm_main 1358 1363 +5 get_header_tar_lzma 52 57 +5 get_header_tar_bz2 52 57 +5 unpack_lzma_stream 2698 2702 +4 hash_find 234 233 -1 get_header_tar 1759 1733 -26 get_header_tar_gz 92 57 -35 unpack_uncompress 51 12 -39 rpm2cpio_main 201 147 -54 unpack_unxz 67 12 -55 unpack_bz2_stream_prime 55 - -55 get_header_tar_Z 86 - -86 unpack_gz_stream_with_info 539 - -539 ------------------------------------------------------------------------------ (add/remove: 3/3 grow/shrink: 14/6 up/down: 947/-890) Total: 57 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* rename archive.h to bb_archive.h. no code changesDenys Vlasenko2011-09-221-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* randomconfig fixesDenys Vlasenko2011-08-101-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: remove "Options:" string from help textsDenys Vlasenko2011-06-051-1/+0
| | | | | | | function old new delta packed_usage 28706 28623 -83 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: store negative mtime as 0; pack very large files using base-256 encodingDenys Vlasenko2011-05-041-4/+32
| | | | | | | function old new delta writeTarHeader 841 979 +138 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* use user's shell instead of hardwired "/bin/sh" (android needs this)Denys Vlasenko2011-03-081-0/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: skip leading / and handle names like abc/..////def -> def (not ///def)Denys Vlasenko2011-03-021-11/+2
| | | | | | | | | function old new delta strip_unsafe_prefix - 105 +105 writeFileToTarball 557 520 -37 get_header_tar 1545 1462 -83 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: fix a bug where autodetection messes up -z on extractDenys Vlasenko2011-02-061-2/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: support -T - and -X -Denys Vlasenko2011-02-031-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: add -h and -T to help textDenys Vlasenko2011-01-311-8/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: add a note about -C and symlink-in-tarball attackDenys Vlasenko2011-01-041-0/+19
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modprobe: add support for --show-dependsSerj Kalichev2010-12-261-1/+0
| | | | | | | | | | | | | function old new delta modprobe_longopts - 16 +16 packed_usage 28018 28028 +10 modprobe_main 648 653 +5 do_modprobe 580 536 -44 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/1 up/down: 31/-44) Total: -13 bytes Signed-off-by: Serj Kalichev <serj.kalichev@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* rename archival/libunarchive -> archival/libarchive; move bz/ into itDenys Vlasenko2010-11-031-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: add xfstat functionDenys Vlasenko2010-08-311-2/+1
| | | | | | | | | | | | | | | | function old new delta xfstat - 25 +25 mkfs_ext2_main 2421 2423 +2 mkfs_reiser_main 1197 1194 -3 next 312 307 -5 ar_main 533 522 -11 mkfs_minix_main 2938 2924 -14 mkfs_vfat_main 1511 1495 -16 writeTarFile 272 255 -17 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/6 up/down: 27/-66) Total: -39 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* *: make GNU licensing statement forms more regularDenys Vlasenko2010-08-161-2/+2
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixesDenys Vlasenko2010-07-061-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: introduce and use xfork() and xvfork()Pascal Bellard2010-07-041-3/+1
| | | | | | | | | | | | | | | | function old new delta launch_helper 170 169 -1 setup_heredoc 312 302 -10 handle_dir_common 367 354 -13 expand_vars_to_list 2456 2443 -13 open_transformer 89 74 -15 data_extract_to_command 439 423 -16 do_ipaddr 1406 1389 -17 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-85) Total: -85 bytes Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: tar-related cleanups: move struct to unarchive.h; move help to tar.cDenys Vlasenko2010-06-261-40/+67
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: optional support for --to-commandLadislav Michl2010-06-251-0/+12
| | | | | | | | | | | | | | | | function old new delta data_extract_to_command - 430 +430 dec2env - 44 +44 tar_main 778 819 +41 str2env - 37 +37 tar_var - 32 +32 xputenv - 22 +22 tar_longopts 257 270 +13 ------------------------------------------------------------------------------ (add/remove: 6/0 grow/shrink: 2/0 up/down: 619/0) Total: 619 bytes Signed-off-by: Ladislav Michl <Ladislav.Michl@seznam.cz> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: small code shrinks and compile fix for unicodeDenys Vlasenko2010-01-201-8/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: handle -m (--touch) switch, enabled by FEATURE_TAR_NOPRESERVE_TIMEMikhail Gusarov2010-01-201-0/+11
| | | | | | | | | | | | | function old new delta .rodata 2731 2779 +48 usage_messages 432 471 +39 tar_main 603 614 +11 tar_longopts 211 219 +8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 106/0) Total: 106 bytes Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: fix recently added SEGV on "tar" w/o argsDenys Vlasenko2009-12-181-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: add support for --overwrite. +70 bytes.Denys Vlasenko2009-12-161-2/+11
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libunarchive: move dpkg-specific things into dpkg.c. 0 byte size differencesDenys Vlasenko2009-12-161-7/+7
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* wget: check for close success; fix chunked; do not bother to send QUIT to ftpDenys Vlasenko2009-12-111-1/+1
| | | | | | Also, random fixes to use %u for unsigned quantities. -14 bytes in wget. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: revert part of last change. -39 bytesDenys Vlasenko2009-11-291-18/+11
| | | | | | | It looks like GNU "tar cf file file" _does_ save file as if it is a hardlink, when it meets it for the second time. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: fix bug 673 (misdetection of repeated dir as hardlink). +92 bytesDenys Vlasenko2009-11-291-55/+71
| | | | | | | | While at it, remove many superfluous ops on unpack: mkdir("."), lots of umask() calls. Can remove more by caching username->uid. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: use "can't" instead of "cannot"Denys Vlasenko2009-11-131-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: add support for -o as synonym to --no-same-owner. +5 bytesBernhard Reutner-Fischer2009-10-251-10/+12
| | | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: handle "tar fx TARFILE" etcDenys Vlasenko2009-10-251-0/+27
| | | | | | | function old new delta tar_main 702 751 +49 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: fix --numeric-owner, --no-same-owner, --no-same-permissions bitsDenys Vlasenko2009-09-171-16/+20
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* switch_root: improve behavior on error; improve help textDenis Vlasenko2009-04-211-1/+1
| | | | | *: make "can't execute '%s'" message uniform
* *: mass renaming of USE_XXXX to IF_XXXXDenis Vlasenko2009-04-211-27/+27
| | | | | | and SKIP_XXXX to IF_NOT_XXXX - the second one was especially badly named. It was not skipping anything!
* tar: support for tar --numeric-owner. By Natanael Copa.Denis Vlasenko2009-04-211-0/+6
| | | | | | | | function old new delta tar_longopts 221 237 +16 data_extract_all 692 705 +13 tar_main 690 702 +12
* tar: stop changing net tarfile's mode, GNU tar doesn't do itDenis Vlasenko2009-01-201-2/+0
|