Commit Graph

1309 Commits

Author SHA1 Message Date
Denys Vlasenko
cd0f6b0c93 consolidate xz format comment. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-01 10:38:10 +02:00
Denys Vlasenko
45f66167fe xz compression detection: avoid the need to seek
function                                             old     new   delta
unpack_unxz                                           12      67     +55
unpack_xz_stream                                    2357    2373     +16
xmalloc_read                                         197     199      +2
setup_unzip_on_fd                                    118      99     -19
rpm2cpio_main                                        222     203     -19
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/2 up/down: 73/-38)             Total: 35 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-01 05:12:28 +02:00
Denys Vlasenko
620e863ba2 bzip2 decompression: simple code shrink
function                                             old     new   delta
unpack_bz2_stream_prime                               60      55      -5
get_header_tar                                      1508    1496     -12

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-30 19:43:44 +02:00
Ladislav Michl
a73b87e934 *: s/"/bin/sh"/DEFAULT_SHELL, run_shell() API fix, remove unneeded strdup
function                                             old     new   delta
run_shell                                            157     166      +9
su_main                                              477     470      -7
sulogin_main                                         515     503     -12

Signed-off-by: Ladislav Michl <Ladislav.Michl@seznam.cz>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-27 03:23:31 +02:00
Denys Vlasenko
b768aeb164 tar: make typical extraction less memory-hungry
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-26 18:22:41 +02:00
Denys Vlasenko
52827e3ebc *: tar-related cleanups: move struct to unarchive.h; move help to tar.c
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-26 18:21:36 +02:00
Denys Vlasenko
d0a8a0d312 tar: fix --to-command wrt short writes
function                                             old     new   delta
bb_copyfd_exact_size                                  51      98     +47
bb_full_fd_action                                    362     394     +32
get_header_tar                                      1546    1558     +12
data_extract_to_command                              430     439      +9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 100/0)             Total: 100 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-26 18:11:44 +02:00
Denys Vlasenko
894fa0ad62 fix breakage in compressed file detection
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-26 05:01:16 +02:00
Ladislav Michl
2b46fd49b1 tar: optional support for --to-command
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>
2010-06-25 01:33:00 +02:00
Denys Vlasenko
d2b738a6d2 decompress_unxz: use common string
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-21 02:16:51 +02:00
Denys Vlasenko
ba73cfd284 unxz: update from XZ embedded git
function                                             old     new   delta
rc_reset                                               -      21     +21
unpack_xz_stream                                    2342    2357     +15
lzma_reset                                           102      64     -38
lzma_len                                             506     443     -63
xz_dec_lzma2_run                                    1438    1374     -64
xz_dec_reset                                          73       -     -73
lzma_main                                           2517    2183    -334
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 1/4 up/down: 36/-572)          Total: -536 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-20 02:40:56 +02:00
Denys Vlasenko
134d0eb114 cosmetics on top of Dan's patches
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-19 20:07:23 +02:00
Dan Fandrich
fdd7b566ec A few minor portability improvements
Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-19 20:03:15 +02:00
Dan Fandrich
b76f18d331 Improve unzip's handling of stream ZIP files
Search harder for the ZIP magic numbers at the end of a file by checking
16 KiB from the end instead of just 1 KiB.  ZIP files with long comments
(such as certain cryptographically signed files) or those sitting in a
wrapper could have more than 1 KiB of data after the magic numbers, so
they couldn't be read.

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-18 13:32:39 +02:00
Denys Vlasenko
d86b4c3907 data_extract_all: do not chmod symlink. Closes 2053
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-18 02:00:55 +02:00
Denys Vlasenko
d70e0e995e *: add INSERTs to *.src files where appropriate
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-08 12:15:11 +02:00
Pascal Bellard
c62f229d45 dpkg: add support for lzma compression
Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-07 01:20:41 +02:00
Denys Vlasenko
19ced5c425 pipe_progress: make it independent of printf machinery
function                                             old     new   delta
bb_putchar_stderr                                      -      24     +24
ParseField                                           494     471     -23
progress_meter                                       212     188     -24
xargs_main                                           888     842     -46
pipe_progress_main                                   151     105     -46
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 0/4 up/down: 24/-139)          Total: -115 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-06 21:53:09 +02:00
Denys Vlasenko
2f32bf8be6 remove defconfig. Now "make defconfig" simply uses defaults from Config.in
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-06 04:14:28 +02:00
Denys Vlasenko
f0f9470061 make it possible to keep usage texts in .c files
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-06 01:53:38 +02:00
Denys Vlasenko
6c5bf0d347 make it possible to have include/applets.h-esque entries in .c files
As an example, bunzip2 and bzcat is changed to use it.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-06 00:53:45 +02:00
Denys Vlasenko
da929a95aa mass renaming Kbuild -> Kbuild.src, Config.in -> Config.src
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-04 20:10:51 +02:00
Denys Vlasenko
26b6ccf340 *: simplify checks for gz/bz2/xz magic
function                                             old     new   delta
send_tree                                            360     355      -5
rpm2cpio_main                                        249     220     -29
setup_unzip_on_fd                                    150     118     -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-66)             Total: -66 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-02 14:14:48 +02:00
Denys Vlasenko
ea8b252cb3 *: better string sharing
text   data    bss    dec    hex filename
 849427    441   7556 857424  d1550 busybox_old
 849355    441   7556 857352  d1508 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-02 12:57:26 +02:00
Denys Vlasenko
8376bfae58 decompress_unxz: allocate permanent crc32 table _fisrt_
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-01 23:26:54 +02:00
Denys Vlasenko
b9542cb2ce deinline two big functions
function                                             old     new   delta
xz_dec_lzma2_run                                       -    1483   +1483
decode_one_format                                      -     715    +715
decode_format_string                                 840      98    -742
unpack_xz_stream                                    4014    2377   -1637
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 0/2 up/down: 2198/-2379)       Total: -181 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-01 23:16:46 +02:00
Denys Vlasenko
716f3f612e decompress_unxz: newer version, one which can unpack SHA-256 protected files
function                                             old     new   delta
check_sizes                                            -      16     +16
crc32_table                                            -       4      +4
index_update                                          47      40      -7
crc32_validate                                       110      93     -17
dec_vli                                              197     165     -32
unpack_xz_stream                                    4284    4014    -270
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 0/4 up/down: 20/-326)          Total: -306 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-01 14:41:39 +02:00
Denys Vlasenko
39a04f71ca archival/*: shrink by reusing sufficiently similar functions
function                                             old     new   delta
append_ext                                             -      16     +16
unxz_main                                             77      83      +6
unlzma_main                                           77      83      +6
uncompress_main                                       42      48      +6
gzip_main                                            184     190      +6
bzip2_main                                           114     120      +6
bunzip2_main                                          61      67      +6
bbunpack                                             469     475      +6
send_tree                                            355     360      +5
lzop_main                                             89      92      +3
gunzip_main                                           61      64      +3
make_new_name_lzop                                    84      82      -2
make_new_name_gunzip                                 114     112      -2
make_new_name_unxz                                    14       -     -14
make_new_name_unlzma                                  14       -     -14
make_new_name_uncompress                              14       -     -14
make_new_name_bunzip2                                 14       -     -14
make_new_name_gzip                                    17       -     -17
make_new_name_bzip2                                   17       -     -17
------------------------------------------------------------------------------
(add/remove: 1/6 grow/shrink: 10/2 up/down: 69/-94)           Total: -25 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-31 14:18:57 +02:00
Denys Vlasenko
c88c1a0190 rpm2cpio: teach it to understand xz format
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-30 05:10:16 +02:00
Denys Vlasenko
acaaca839a unxz: remove debugging. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-30 04:50:21 +02:00
Denys Vlasenko
6948f210ed *: teach tar et. al. to understand .xz by heart
function                                             old     new   delta
unpack_xz_stream                                       -    4126   +4126
setup_unzip_on_fd                                     80     150     +70
open_zipped                                          113     131     +18
unpack_unxz                                            5      12      +7
send_tree                                            360     353      -7
unpack_xz_stream_stdin                              3953       -   -3953
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 3/1 up/down: 4221/-3960)        Total: 261 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-30 04:18:13 +02:00
Denys Vlasenko
fb6c76cb6e forgotten "git add"...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-30 03:47:40 +02:00
Denys Vlasenko
d93f19e443 reorder parts of bbunzip.c, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-30 03:46:54 +02:00
Denys Vlasenko
602ce69afb unxz: new applet, complete with xzcat and xz -d aliases
function                                             old     new   delta
unpack_xz_stream_stdin                                 -    3953   +3953
lzma_main                                              -    2601   +2601
lzma_len                                               -     516    +516
dec_vli                                                -     165    +165
dict_repeat                                            -     103    +103
lzma_reset                                             -      98     +98
fill_temp                                              -      98     +98
crc32_validate                                         -      93     +93
xz_dec_reset                                           -      77     +77
unxz_main                                              -      77     +77
index_update                                           -      47     +47
xz_crc32                                               -      40     +40
packed_usage                                       27044   27060     +16
make_new_name_unxz                                     -      14     +14
applet_names                                        2240    2254     +14
applet_main                                         1312    1324     +12
applet_nameofs                                       656     662      +6
unpack_unxz                                            -       5      +5
send_tree                                            355     360      +5
applet_install_loc                                   164     166      +2
------------------------------------------------------------------------------
(add/remove: 15/0 grow/shrink: 6/0 up/down: 7942/0)          Total: 7942 bytes
   text    data     bss     dec     hex filename
 844032     453    6812  851297   cfd61 busybox_old
 852063     453    6812  859328   d1cc0 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-30 03:35:18 +02:00
Denys Vlasenko
e04c867a21 rename FEATURE_LZMA_ALIAS to just LZMA
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-30 03:33:50 +02:00
Denys Vlasenko
8bcaa6a4e9 lzop: fix indentation
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-30 01:57:52 +02:00
Bernhard Reutner-Fischer
7bdfb7cbf0 bbunzip: silence warning about unused variable
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-05-27 15:39:01 +02:00
Denys Vlasenko
ccb88a689e unlzma: add "lzma -d" alias, add -t support, rename lzmacat->lzcat
Also coalesce some common strings

   text    data     bss     dec     hex filename
 844110     453    6812  851375   cfdaf busybox_old
 844061     453    6812  851326   cfd7e busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-27 02:22:54 +02:00
Denys Vlasenko
fc2bb8f04f unzip: another small code shrink
function                                             old     new   delta
find_cdf_offset                                      173     160     -13

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-24 13:07:55 +02:00
Denys Vlasenko
e98884b9be unzip: tiny code shrink -2 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-24 04:46:18 +02:00
Denys Vlasenko
4e8ff73e20 unzip: restore unix file mode if possible. closes bug 1045
function                                             old     new   delta
unzip_main                                          2197    2188      -9
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/1 up/down: 173/-182)           Total: -9 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-24 04:33:02 +02:00
Denys Vlasenko
ff0e875e02 work on adding testsuite runs to randomconfig test builds
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-10 04:16:43 +02:00
Denys Vlasenko
7b48eb4372 tar: support GNU 256-bit encoding in all numeric fields
function                                             old     new   delta
getOctal                                              63     125     +62
get_header_tar                                      1572    1496     -76
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 62/-76)            Total: -14 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-06 20:08:14 +02:00
Denys Vlasenko
5dfd9c4dbc rpm: make rpm -i SRPM.rpm install it to surrent dir; better help text
function                                             old     new   delta
rpm_main                                            1355    1358      +3
packed_usage                                       26732   26728      -4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 3/-4)               Total: -1 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-06 16:56:38 +02:00
Denys Vlasenko
27653adc8b rpm: code shrink. Now uses open_zipped's logic (factored out into setup_unzip_on_fd())
function                                             old     new   delta
setup_unzip_on_fd                                      -      80     +80
open_zipped                                          176     113     -63
rpm_main                                            1672    1355    -317
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 80/-380)          Total: -300 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-06 14:19:19 +00:00
Matheus Izvekov
4640ccc399 cpio: "NNN blocks" should go to stderr
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-26 13:53:57 +02:00
Nguyễn Thái Ngọc Duy
36dcf4e516 ar: fix a regression: "ar t arch.a" stopped shoting files
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-15 16:55:04 -07:00
Denys Vlasenko
e69ad87802 tar: fix "hardlinks to symlinks chown" bug 1519.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-09 14:11:45 +02:00
Denys Vlasenko
02365a6ef7 tar: fix mishandling of repeated hardlink in tarball; expand tests
function                                             old     new   delta
data_extract_all                                     727     767     +40
get_header_tar                                      1576    1572      -4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-09 10:52:52 +02:00
Denys Vlasenko
84f6def072 dpkg: remove redundant check
function                                             old     new   delta
dpkg_main                                           4008    3991     -17

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-30 16:20:34 +02:00
Denys Vlasenko
eab75f6049 dpkg: better check for validity of options
function                                             old     new   delta
dpkg_main                                           3980    4008     +28

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-30 15:03:26 +02:00
Kim B. Heino
3d43aed10c dpkg: support config file overwrite options
function                                             old     new   delta
filter_rename_config                                   -     244    +244
static.dpkg_longopts                                   -     112    +112
dpkg_main                                           3901    3980     +79
unpack_package                                       515     587     +72
append_control_file_to_llist                           -      72     +72
data_extract_all_prefix                               88     116     +28
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 3/0 up/down: 607/0)             Total: 607 bytes

Signed-off-by: Kim B. Heino <Kim.Heino@bluegiga.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-29 14:18:27 +02:00
J. Tang
77a2c51e79 tar: optional support for restoring selinux context
function                                             old     new   delta
get_header_tar                                      1690    1976    +286
data_extract_all                                     821     881     +60
.rodata                                           151446  151503     +57
get_header_cpio                                     1044    1077     +33
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 436/0)             Total: 436 bytes

Signed-off-by: J. Tang <tang@jtang.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-19 14:48:51 +01:00
Kim B. Heino
820874ed38 tar compability modes for dpkg
I've found couple of deb files which require old tar compability modes
to be unpacked. This patch allows me to enable them for dpkg without
enabling tar.

Signed-off-by: Kim B. Heino <Kim.Heino@bluegiga.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-15 23:55:26 +01:00
Alexander Shishkin
535584c750 ar: add archive creation support
function                                             old     new   delta
ar_main                                              184     542    +358
output_ar_header                                       -     166    +166
copy_data                                              -      54     +54
filter_replaceable                                     -      19     +19
get_header_ar                                        409     414      +5
header_verbose_list_ar                                85      88      +3
static.msg_unsupported_err                            28       -     -28
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 3/0 up/down: 605/-28)           Total: 577 bytes

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-15 15:38:09 +01:00
Joakim Tjernlund
0866b36900 gunzip: inflate_codes(): add fix from upstream gzip to prevent false CRC error
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-11 23:56:48 +01:00
Denys Vlasenko
98a4c7cf3d *: suppress ~60% of "aliased warnings" on gcc-4.4.1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-02-04 15:00:15 +01:00
Denys Vlasenko
083e172641 style fixes, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-28 12:30:24 +01:00
Denys Vlasenko
6b9f163353 *: style fixes. no code changes (verified with objdump)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-28 02:24:24 +01:00
Denys Vlasenko
6b01b71e83 randomconfig fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-24 22:52:21 +01:00
Denys Vlasenko
94ca6943bc *: small code shrinks and compile fix for unicode
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-20 02:51:09 +01:00
Mikhail Gusarov
0d478334b3 tar: handle -m (--touch) switch, enabled by FEATURE_TAR_NOPRESERVE_TIME
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>
2010-01-20 02:47:37 +01:00
Denys Vlasenko
02dd96f688 cpio: fix -o-less cpio -F FILE
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-09 20:25:42 +01:00
Denys Vlasenko
607f65d171 cpio: improve help text more; fix -p and -F interaction
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-09 20:23:03 +01:00
Denys Vlasenko
93ac7d8468 cpio: improve help text; document two TODOs
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-09 19:56:15 +01:00
Denys Vlasenko
dc698bb038 *: make it easier to distinquish "struct tm", pointer to one, etc
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-09 19:10:49 +01:00
Denys Vlasenko
6fd42b3d00 dpkg: fix handling of names with leading dots. Closes bug 783
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-08 18:07:33 +01:00
Denys Vlasenko
aa4977d8e5 libunarchive: clean up dirty hacks. code shrank as a result
function                                             old     new   delta
cpio_main                                            526     539     +13
init_handle                                           57      58      +1
init_archive_deb_ar                                   34      35      +1
get_header_ar                                        408     409      +1
dpkg_main                                           3900    3901      +1
unpack_package                                       516     515      -1
rpm_main                                            1673    1672      -1
tar_main                                             774     767      -7
get_header_cpio                                      990     972     -18
data_extract_all                                     750     727     -23
get_header_tar                                      1631    1576     -55
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/6 up/down: 17/-105)           Total: -88 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-06 10:53:17 +01:00
Denys Vlasenko
bde70230e8 libunarchive: trivial code shrink
function                                             old     new   delta
header_verbose_list                                  257     237     -20

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-06 09:43:11 +01:00
Matheus Izvekov
839fd71077 gzip: add optional support for --long-opts
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-06 08:54:49 +01:00
Denys Vlasenko
af1c8e8be0 cpio: fix unpacking of names with leading slashes
function                                             old     new   delta
get_header_cpio                                      968     990     +22
cpio_main                                            533     526      -7

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-05 04:43:21 +01:00
Denys Vlasenko
4928f3b90b ar: heh, there *was* "-1" already...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-04 14:32:31 +01:00
Denys Vlasenko
40e5a30b66 ar: fix two bugs, one added by prev comment and other we SEGV with no params
cpio: use optind less

function                                             old     new   delta
ar_main                                              189     184      -5
cpio_main                                            549     533     -16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-21)             Total: -21 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-04 14:30:37 +01:00
Denys Vlasenko
2ec91aead5 *: remove some uses of argc
function                                             old     new   delta
whoami_main                                           34      37      +3
logname_main                                          60      63      +3
hostid_main                                           35      38      +3
ttysize_main                                         136     135      -1
nmeter_main                                          673     672      -1
logger_main                                          387     386      -1
uuencode_main                                        330     328      -2
ifupdown_main                                       2125    2123      -2
mesg_main                                            158     155      -3
free_main                                            333     330      -3
cal_main                                             902     899      -3
acpid_main                                           443     440      -3
ar_main                                              196     189      -7
find_main                                            476     467      -9
ifconfig_main                                       1235    1221     -14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/12 up/down: 9/-49)            Total: -40 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-04 14:15:38 +01:00
Denys Vlasenko
d6459685c1 tar: fix problem handling tarballs with chksums prepended by spaces
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-03 23:41:11 +01:00
Denys Vlasenko
c066472b0c *: do not assign to stdout/stderr, it's not portable.
Based on patch by Aaron Carroll <xaaronc@gmail.com>

function                                             old     new   delta
time_main                                           1062    1052     -10
cpio_main                                            563     549     -14

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-01-02 18:49:22 +01:00
Denys Vlasenko
4b6abf6655 tar: fix recently added SEGV on "tar" w/o args
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-18 12:36:07 +01:00
Denys Vlasenko
8a936cfab7 tar: add support for --overwrite. +70 bytes.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-16 23:18:59 +01:00
Denys Vlasenko
425ad9c93b libunarchive: move dpkg-specific things into dpkg.c. 0 byte size differences
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-16 22:46:01 +01:00
Denys Vlasenko
a3aa3e3095 wget: check for close success; fix chunked; do not bother to send QUIT to ftp
Also, random fixes to use %u for unsigned quantities. -14 bytes in wget.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-12-11 12:36:10 +01:00
Denys Vlasenko
dcbfaba264 fix improper utimes usage
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-29 19:40:36 +01:00
Denys Vlasenko
d43d628f8b tar: revert part of last change. -39 bytes
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>
2009-11-29 16:28:33 +01:00
Denys Vlasenko
f94c9bf288 tar: fix bug 673 (misdetection of repeated dir as hardlink). +92 bytes
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>
2009-11-29 07:45:33 +01:00
Denys Vlasenko
6ccaa23f2b libunarchive: fix reversed test for older/newer
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-24 01:16:12 +01:00
Denys Vlasenko
389cca4b9e some non-gnu compilers can't have non-const struct initializers
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-15 02:28:56 +01:00
Bernhard Reutner-Fischer
a307af1af6 use utimes() rather than obsolescent utime()
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-11-15 00:12:53 +01:00
Bernhard Reutner-Fischer
cc8b6871a7 use utimes() rather than obsolescent utime()
utime is obsolescent in POSIX.1-2008, use utimes() for now.
Untested.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-11-14 23:35:00 +01:00
Denys Vlasenko
6331cf059c *: use "can't" instead of "cannot"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-13 09:08:27 +01:00
Denys Vlasenko
8131eea3dc *: introduce and use ffulsh_all()
function                                             old     new   delta
buffer_fill_and_print                                179     196     +17
fflush_all                                             -       9      +9
spawn                                                 87      92      +5
rtcwake_main                                         455     453      -2
...
alarm_intr                                            93      84      -9
readcmd                                             1072    1062     -10
bb_ask                                               345     333     -12
more_main                                            845     832     -13
flush_stdout_stderr                                   42      23     -19
xfflush_stdout                                        27       -     -27
flush_stderr                                          30       -     -30
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 2/50 up/down: 31/-397)         Total: -366 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-11-02 14:19:51 +01:00
Bernhard Reutner-Fischer
30f3c1d5fd tar: add support for -o as synonym to --no-same-owner. +5 bytes
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-25 02:13:32 +02:00
Denys Vlasenko
f645037ffb tar: handle "tar fx TARFILE" etc
function                                             old     new   delta
tar_main                                             702     751     +49

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-25 01:32:45 +02:00
Denys Vlasenko
f2cbb03a37 *: optimize most of isXXXXX() macros
text    data     bss     dec     hex filename
 824164     453    6812  831429   cafc5 busybox_old
 823730     453    6812  830995   cae13 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-23 03:16:08 +02:00
Denys Vlasenko
ef5bc2c39c *: three more NOINLINEs
function                                             old     new   delta
lzo_decompress                                         -     525    +525
lzo_compress                                           -     470    +470
showmode                                               -     330    +330
fbset_main                                          1698    1273    -425
do_lzo_compress                                      799     323    -476
do_lzo_decompress                                   1167     526    -641
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 0/3 up/down: 1325/-1542)       Total: -217 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-08 14:54:18 +02:00
Denys Vlasenko
adf922ec28 *: a few more NOINLINEs
function                                             old     new   delta
print_linkinfo                                         -     815    +815
do_msg                                                 -     783    +783
INET_setroute                                          -     757    +757
varvalue                                               -     746    +746
do_sem                                                 -     637    +637
inflate_codes                                          -     617    +617
INET6_setroute                                         -     491    +491
edir                                                   -     370    +370
sync_cursor                                            -     298    +298
update_utmp                                            -     246    +246
searchLines                                            -     165    +165
setup_alarm                                            -     144    +144
may_wakeup                                             -     101    +101
getNum                                               566     371    -195
refresh                                             1166     848    -318
rtcwake_main                                         809     479    -330
getty_main                                          2396    1921    -475
chpst_main                                          1373     746    -627
inflate_unzip_internal                              1335     567    -768
evalvar                                             1384     612    -772
ipaddr_list_or_flush                                2160    1246    -914
route_main                                          1585     245   -1340
ipcs_main                                           2523    1049   -1474
------------------------------------------------------------------------------
(add/remove: 13/0 grow/shrink: 0/10 up/down: 6170/-7213)    Total: -1043 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-08 14:35:37 +02:00
Denys Vlasenko
a7bb3c1396 *: code shrink via NOINLINE
function                                             old     new   delta
expand_vars_to_list                                    -    2118   +2118
lzo1x_optimize                                         -    1429   +1429
run_pipe                                             358    1775   +1417
arith_apply                                            -    1335   +1335
mainQSort3                                             -    1198   +1198
logdir_open                                            -    1163   +1163
rewrite                                                -    1039   +1039
dump_identity                                          -     987    +987
do_shm                                                 -     884    +884
cpio_o                                                 -     863    +863
cpio_main                                           1450     560    -890
ipcs_main                                           3442    2523    -919
bb_dump_dump                                        2611    1488   -1123
process_dev                                         4572    3405   -1167
logdirs_reopen                                      1308      86   -1222
arith                                               2084     707   -1377
mainSort                                            2622    1202   -1420
do_lzo_compress                                     2276     799   -1477
run_list                                            2491     943   -1548
expand_variables                                    2280     135   -2145
------------------------------------------------------------------------------
(add/remove: 9/0 grow/shrink: 1/10 up/down: 12433/-13288)    Total: -855 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-08 12:28:08 +02:00
Denys Vlasenko
dcd27abcc4 unpackers: check errors from close() too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-10-05 03:03:07 +02:00
Denys Vlasenko
606291beab *: more portability fixes by Dan Fandrich
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-23 23:15:43 +02:00
Denys Vlasenko
8d338173a4 tar: accept spaces at the end of header fields (compat)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-23 17:16:37 +02:00
Denys Vlasenko
2bf6634ef4 ar: fix long filenames handling (bug 611)
function                                             old     new   delta
get_header_ar                                        493     528     +35
read_num                                               -      25     +25

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-20 01:28:27 +02:00
Denys Vlasenko
885583ebe3 tar: do chown, not lchown to restore mode (compat)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-17 03:02:57 +02:00
Denys Vlasenko
d57d62686d tar: fix --numeric-owner, --no-same-owner, --no-same-permissions bits
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-17 02:43:14 +02:00
Denys Vlasenko
8dc0e1929e use PACKED macro insted of open-coding GCC-ism
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-16 00:58:11 +02:00
Denys Vlasenko
f2c184be83 unlzma: fixed speedup/shrink by Pascal Bellard (pascal.bellard AT ads-lu.com)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-15 23:40:08 +02:00
Denys Vlasenko
40c221334f Merge branch 'master' of git+ssh://vda@busybox.net/var/lib/git/busybox 2009-09-07 12:44:56 +02:00
Denys Vlasenko
386bc9fda3 unzip: more compat if DESKTOP=y
function                                             old     new   delta
DESKTOP off:
unzip_main                                          1648    1629     -19
DESKTOP=y:
unzip_main                                          1939    2197    +258

Without this, midnight commander can't display .zip files

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-06 16:52:50 +02:00
Denys Vlasenko
3de3f57c6d Revert "unlzma: speedup, by Pascal Bellard (pascal.bellard AT ads-lu.com)"
https://bugs.busybox.net/show_bug.cgi?id=599

This reverts commit 9ac3dc764a.
2009-09-06 15:06:25 +02:00
Denys Vlasenko
5370bfb123 documentation and typo fixes. By Dan Fandrich (dan AT coneharvesters.com)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-06 02:58:59 +02:00
Denys Vlasenko
90a9904e9e remove some GNUisms. by Dan Fandrich (dan AT coneharvesters.com)
function                                             old     new   delta
logdirs_reopen                                      1310    1308      -2
read_line_input                                     4757    4753      -4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-6)               Total: -6 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-06 02:36:23 +02:00
Denys Vlasenko
b9762922d1 libunarchive: fix a bug where mode and time is no longer restored
Introduced by me in 1.15.x. Found by Rob Landley.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-30 01:18:34 +02:00
Denys Vlasenko
e6c483ec30 rpm2cpio: code shrink
function                                             old     new   delta
skip_header                                           94      92      -2
rpm2cpio_main                                        177     174      -3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-5)               Total: -5 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-28 21:15:24 +02:00
Denys Vlasenko
0a130d510d rpm2cpio: handle unseekable input correctly
function                                             old     new   delta
data_skip                                             14      20      +6
seek_by_jump                                          67      72      +5
data_align                                            81      84      +3
seek_by_read                                          20      19      -1
skip_header                                           99      94      -5
rpm2cpio_main                                        183     177      -6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/3 up/down: 14/-12)              Total: 2 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-28 21:09:51 +02:00
Pascal Bellard
7f2149489f rpm2cpio: handle bz2 too; code shrink
function                                             old     new   delta
skip_header                                          142      99     -43
rpm2cpio_main                                        321     183    -138
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-181)           Total: -181 bytes

Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-28 06:20:33 +02:00
Denys Vlasenko
d1090c91cc dpkg: delete postrm script after it's run, not before. closes bug 449
function                                             old     new   delta
purge_package                                        220     252     +32

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-25 11:52:32 +02:00
Stefani Seibold
f3b56b428f unzip: try lseek before resorting to reading
function                                             old     new   delta
unzip_skip                                            16      43     +27

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-25 02:02:22 +02:00
Denys Vlasenko
9038d6f8f5 remove trailing whitespace
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-15 20:02:19 +02:00
Denys Vlasenko
b773f715d6 tar: handle 256-base encoding in mtime
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-08 18:58:09 +02:00
Denys Vlasenko
09e63bb81f df: fix "df /"
also, clean up mount checks in mkfs/fsck.

function                                             old     new   delta
find_mount_point                                     243     261     +18
sha1_process_block64                                 497     510     +13
find_main                                            436     444      +8
display_speed                                         85      90      +5
df_main                                              795     793      -2
parse_command                                       1463    1460      -3
static.ignored_mounts                                  8       -      -8
mkfs_minix_main                                     2962    2937     -25
fsck_minix_main                                     3065    2970     -95
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 4/4 up/down: 44/-133)           Total: -89 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-05 04:50:36 +02:00
Denys Vlasenko
d30b89c7ee updates for supporting Linux kernel build and initrd utilities
cpio: --verbose, --quiet, --to-stdout
test: make 64-bit math enable-able for hush too
dnsdomainname: alias to hostname -d
hostname: support --fqdn, --domain, --file

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-26 01:55:45 +02:00
Denys Vlasenko
f3b92d3856 getopt: FEATURE_GETOPT_LONG for -l; rename GETOPT_LONG to LONG_OPTS
Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-19 12:10:38 +02:00
Denys Vlasenko
bcbd37df24 tweak Config texts and some broken English elsewhere
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-18 13:23:58 +02:00
Denys Vlasenko
2634bf366b randomconfig fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-09 18:40:07 +02:00
Mike Frysinger
b9f2bb36ea only build common libarchive objs when needed
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-28 00:47:14 -04:00
Denys Vlasenko
167cd709df gzip: fix gzip with many files corrupting some files after first
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-18 13:08:57 +02:00
Mike Frysinger
4f239b1bb4 libunarchive: fix build failure with !FEATURE_TAR_UNAME_GNAME
We can't use C if(...) with ENABLE_FEATURE_TAR_UNAME_GNAME because it
relies on conditional members in the file_header_t structure:

archival/libunarchive/data_extract_all.c: In function ‘data_extract_all’:
archival/libunarchive/data_extract_all.c:123: error: ‘file_header_t’ has no member named ‘uname’
archival/libunarchive/data_extract_all.c:124: error: ‘file_header_t’ has no member named ‘uname’
archival/libunarchive/data_extract_all.c:127: error: ‘file_header_t’ has no member named ‘gname’
archival/libunarchive/data_extract_all.c:128: error: ‘file_header_t’ has no member named ‘gname’
make[1]: *** [archival/libunarchive/data_extract_all.o] Error 1

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-05 07:00:27 -04:00
Denis Vlasenko
052ad9a568 lzop: new applet. Busyboxed by Alain Knaff. +7700 bytes. 2009-04-29 12:01:51 +00:00
Denis Vlasenko
9ac3dc764a unlzma: speedup, by Pascal Bellard (pascal.bellard AT ads-lu.com)
LZMA_FAST off: 10% faster and:
function                                             old     new   delta
rc_is_bit_1                                            -      92     +92
rc_do_normalize                                       45      81     +36
rc_update_bit_1                                       25       -     -25
rc_update_bit_0                                       30       -     -30
rc_is_bit_0_helper                                    38       -     -38
rc_get_bit                                            60      17     -43
rc_read                                               48       -     -48
unpack_lzma_stream                                  1768    1517    -251
------------------------------------------------------------------------------
(add/remove: 1/4 grow/shrink: 1/2 up/down: 128/-435)         Total: -307 bytes

LZMA_FAST on: 14% faster and:
unpack_lzma_stream                                  2301    2737    +436
rc_get_bit                                           106       -    -106
2009-04-25 12:19:35 +00:00
Denis Vlasenko
f9d4fc3cf8 switch_root: improve behavior on error; improve help text
*: make "can't execute '%s'" message uniform
2009-04-21 20:40:51 +00:00
Denis Vlasenko
5e34ff29bc *: mass renaming of USE_XXXX to IF_XXXX
and SKIP_XXXX to IF_NOT_XXXX - the second one was especially
badly named. It was not skipping anything!
2009-04-21 11:09:40 +00:00
Denis Vlasenko
8b814b4a34 tar: support for tar --numeric-owner. By Natanael Copa.
function                                             old     new   delta
tar_longopts                                         221     237     +16
data_extract_all                                     692     705     +13
tar_main                                             690     702     +12
2009-04-21 00:52:21 +00:00
Denis Vlasenko
3266aa9ec2 trailing whitespace removal 2009-04-01 11:24:04 +00:00
Denis Vlasenko
05af832097 cpio: more compat: -0 and -L options
function                                             old     new   delta
cpio_main                                           1417    1473     +56
2009-03-20 23:01:48 +00:00
Denis Vlasenko
83518d18a3 Compatibility fixes:
grep: support -z
find: support --mindepth
  together +45 bytes
cpio: support -p (configurable, +230 bytes)
libbb: tweaks for cpio
2009-03-20 22:17:13 +00:00
Denis Vlasenko
1f0b95f147 tar: make FEATURE_TAR_AUTODETECT work with DESKTOP off too. 2009-03-13 14:26:44 +00:00
Denis Vlasenko
9aa5c652e9 unzip: fix thinko with le/be conv and size (closes bug 129)
awk: make "struct global" hack more robust wrt alignment (closes bug 131)
2009-02-26 11:21:04 +00:00
Denis Vlasenko
498436586e tar: stop changing net tarfile's mode, GNU tar doesn't do it 2009-01-20 02:52:57 +00:00
Denis Vlasenko
ab6b446e95 header_verbose_list: show off_t size, not cast to (unsigned)
get_header_tar: support GNU tar's "base256" encoding

function                                             old     new   delta
get_header_tar                                      1536    1600     +64
header_verbose_list                                  242     257     +15
2008-12-12 02:14:35 +00:00
Denis Vlasenko
efb545b9bd optimize 16- and 32-bit moves
function                                             old     new   delta
udhcpd_main                                         1239    1257     +18
udhcp_add_simple_option                               93      92      -1
buffer_read_le_u32                                    19      18      -1
unpack_gz_stream_with_info                           526     520      -6
dnsd_main                                           1470    1463      -7
udhcp_run_script                                    1208    1186     -22
send_ACK                                             255     229     -26
arping_main                                         1661    1623     -38
send_offer                                           470     428     -42
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/8 up/down: 18/-143)          Total: -125 bytes
2008-12-08 22:56:18 +00:00
Denis Vlasenko
b8baf407aa dpkg: better and shorter code to compare versions
(taken from "official" dpkg).
 By Eugene T. Bordenkircher (eugebo AT gmail.com)

function                                             old     new   delta
order                                                  -      48     +48
test_version                                         273     276      +3
version_compare_part                                 396     187    -209
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/1 up/down: 51/-209)          Total: -158 bytes
2008-11-20 23:41:56 +00:00
Denis Vlasenko
1a9e9bdd93 gunzip: restore mtime. approx +80 bytes of code
rpm: make code more robust
lsmod: small code shrink
2008-11-01 12:54:56 +00:00
Denis Vlasenko
c503dde01a cpio: emit TRAILER even when hard links were found.
by Pascal Bellard (pascal.bellard AT ads-lu.com)
2008-10-26 19:55:20 +00:00
Denis Vlasenko
73d702ee07 tar: fix typo in comment 2008-10-25 09:27:35 +00:00
Denis Vlasenko
ebad0294c9 tar: fix bug 3844: non-root tar does not preserve perms 2008-10-24 23:47:38 +00:00
Denis Vlasenko
cf4dd07b28 cpio: fix regression in prev commit (harmless) 2008-10-17 14:11:04 +00:00
Denis Vlasenko
d83676ec47 data_extract_all: do not complain if directory exists on mkdir
rpm/cpio: move "20653 blocks" printout from get_header_cpio to cpio_main -
rpm doesn't want to have that
2008-10-17 14:03:56 +00:00
Denis Vlasenko
aa9eb1fc67 rpm: fix incompatibilities which prevented rpm -i foo.src.rpm
function                                             old     new   delta
fileaction_setowngrp                                  57      89     +32
2008-10-16 13:29:13 +00:00
Denis Vlasenko
8854b352f4 build system: dpkg needs .gz handling 2008-10-15 14:50:14 +00:00
Denis Vlasenko
07e05c100f unzip: remove example of a file we now can handle 2008-10-09 13:52:30 +00:00
Bernhard Reutner-Fischer
97516fc3a6 - add dpkg -l <packagepattern> (Peter Korsgaard) 2008-09-25 12:18:49 +00:00
Denis Vlasenko
006e8628fc unzip: handle "central directory"
needed for OpenOffice, gmail attachment .zips etc
 conditional on CONFIG_DESKTOP

function                                             old     new   delta
unzip_main                                          1643    1939    +296
find_cds_offset                                        -     173    +173
unzip_skip                                            11      16      +5
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/0 up/down: 474/0)             Total: 474 bytes
2008-09-21 01:01:46 +00:00
Denis Vlasenko
540baf646a man: add handling of "man links", by Ivana Varekova <varekova AT redhat.com>
function                                             old     new   delta
run_pipe                                             102     354    +252
show_manpage                                           -     126    +126
man_main                                             705     615     -90
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/1 up/down: 378/-90)           Total: 288 bytes
2008-08-05 13:16:18 +00:00
Denis Vlasenko
e9ad84dfd4 *: refactor handling of archived files. "tar f file.tar.lzma" now works too.
function                                             old     new   delta
unpack_Z_stream                                        -    1229   +1229
open_zipped                                            -     176    +176
unpack_bz2_stream_prime                                -      60     +60
tar_main                                             642     677     +35
find_main                                            406     418     +12
sv_main                                             1222    1233     +11
decode_format_string                                 829     837      +8
cmp_main                                             641     649      +8
popstring                                            134     140      +6
filter_accept_list_reassign                          120     125      +5
parse_and_put_prompt                                 800     804      +4
passwd_main                                         1053    1049      -4
make_new_name_gunzip                                 119     114      -5
rpm_main                                            1688    1670     -18
prepare                                              302     283     -19
xmalloc_open_zipped_read_close                       135      61     -74
uncompress                                          1229       -   -1229
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 8/5 up/down: 1554/-1349)        Total: 205 bytes
2008-08-05 13:10:34 +00:00
Denis Vlasenko
27842288b3 libbb: make xrealloc_vector zero out the realloc'ed tail
function                                             old     new   delta
xrealloc_vector_helper                                51      76     +25
man_main                                             712     705      -7
act                                                  250     234     -16
create_list                                           91      70     -21
getopt_main                                          695     664     -31
load_dep_bb                                          281     248     -33
fileAction                                           744     709     -35
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/6 up/down: 25/-143)          Total: -118 bytes
2008-08-04 13:20:36 +00:00
Denis Vlasenko
48a9971bd4 unzip: move check for unsupported zip features to better place 2008-07-26 17:32:41 +00:00
Denis Vlasenko
c2dcb7cf63 unzip: give better error message when presented with unsupported
zip file. Add zip documentation and an example of file we cant
 (yet) unpack.
2008-07-26 16:50:24 +00:00
Denis Vlasenko
68a192c007 fix trivial build warning 2008-07-22 19:38:57 +00:00
Bernhard Reutner-Fischer
3e8669f359 - wrap overlong lines (Cristian Ionescu-Idbohrn)
- s/\.  /. /g;# (me)
2008-07-22 18:27:53 +00:00
Denis Vlasenko
5415c856ea libbb: [x]fopen_for_{read,write} introduced and used.
(by Valdimir)

function                                             old     new   delta
config_open2                                           -      41     +41
config_read                                          507     542     +35
find_pair                                            169     187     +18
fopen_for_write                                        -      14     +14
fopen_for_read                                         -      14     +14
find_main                                            406     418     +12
xfopen_for_write                                       -      10     +10
xfopen_for_read                                        -      10     +10
popstring                                            134     140      +6
parse_inittab                                        396     401      +5
next_token                                           923     928      +5
pack_gzip                                           1659    1661      +2
bb__parsespent                                       117     119      +2
fallbackSort                                        1719    1717      -2
evalvar                                             1376    1374      -2
qrealloc                                              36      33      -3
...
...
...
...
singlemount                                         4579    4569     -10
process_stdin                                        443     433     -10
patch_main                                          1111    1101     -10
ifupdown_main                                       2175    2165     -10
file_action_grep                                      90      80     -10
uuidcache_init                                       649     637     -12
hush_main                                            797     785     -12
read_config                                          230     217     -13
dpkg_main                                           3835    3820     -15
read_line_input                                     3134    3110     -24
sysctl_main                                          232     203     -29
config_open                                           40      10     -30
WARN_BAD_LINE                                         44       -     -44
login_main                                          1714    1575    -139
------------------------------------------------------------------------------
(add/remove: 5/1 grow/shrink: 8/74 up/down: 174/-737)        Total: -563 bytes
2008-07-21 23:05:26 +00:00
Denis Vlasenko
adc772a5f2 tar: fix handling of tarballs with symlinks with size field != 0 2008-07-20 17:10:43 +00:00
Denis Vlasenko
bc06fb27d2 build system: fix indentation in config menu 2008-07-17 18:26:45 +00:00
Denis Vlasenko
4d0cd28947 cpio: make long opts depend only on ENABLE_GETOPT_LONG 2008-07-16 21:51:43 +00:00
Denis Vlasenko
52ec4b98d5 whitespace fixes 2008-07-12 23:02:43 +00:00
Denis Vlasenko
a46dd89e94 cpio: internalize archive_xread_all_eof. add a few paranoia checks
for corrupted cpio files.
modprobe-small: remove stray include
route: small code shrink

function                                             old     new   delta
get_header_cpio                                      958     980     +22
archive_xread_all_eof                                 33       -     -33
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/0 up/down: 22/-33)            Total: -11 bytes
2008-07-12 09:20:44 +00:00
Denis Vlasenko
ee1b3b1042 cpio: on unpack, limit filename length to 8k; shorten comment a bit 2008-07-11 22:20:59 +00:00
Denis Vlasenko
2b407b12be cpio: support some long options; document GNU options 2008-07-11 21:42:12 +00:00
Denis Vlasenko
86090e2599 fix compile failures resulting from last few commits 2008-07-11 08:23:52 +00:00
Denis Vlasenko
0381d422d9 dpkg_deb: slight code shrink
ar: reuse existing ar unpacking code
get_header_tar: handle autodetection for tiny .tar.gz files too
unarchive.h: do not include CONFIGed out things

function                                             old     new   delta
get_header_tar                                      1521    1534     +13
dpkg_deb_main                                        400     380     -20
ar_main                                              260     196     -64
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 13/-84)            Total: -71 bytes
2008-07-10 23:06:00 +00:00
Denis Vlasenko
b6052724ff open_transformer: do not return fd, it does not change
libbb: adopt zipped read from modprobe-small

function                                             old     new   delta
getoptscmd                                           708     713      +5
qgravechar                                           106     109      +3
huft_build                                          1165    1168      +3
tr_main                                              474     472      -2
open_transformer                                      91      89      -2
evalvar                                             1376    1374      -2
rpm_main                                            1691    1688      -3
qrealloc                                              36      33      -3
get_header_tar_lzma                                   55      52      -3
get_header_tar_gz                                    100      97      -3
get_header_tar_bz2                                    55      52      -3
get_header_tar_Z                                      89      86      -3
find_main                                            418     406     -12
prepare                                              302     283     -19
xmalloc_open_zipped_read_close                       161     135     -26
xmalloc_read                                         248     199     -49
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/13 up/down: 11/-130)         Total: -119 bytes
2008-07-10 17:43:01 +00:00
Denis Vlasenko
deeed59de0 libbb: introduce and use xrealloc_vector
function                                             old     new   delta
xrealloc_vector_helper                                 -      51     +51
create_list                                           84      99     +15
getopt_main                                          690     695      +5
passwd_main                                         1049    1053      +4
get_cached                                            85      89      +4
msh_main                                            1377    1380      +3
add_match                                             42      41      -1
read_lines                                           720     718      -2
grave                                               1068    1066      -2
fill_match_lines                                     143     141      -2
add_to_dirlist                                        67      65      -2
add_input_file                                        49      47      -2
act                                                  252     250      -2
fsck_main                                           2252    2246      -6
man_main                                             765     757      -8
bb_internal_initgroups                               228     220      -8
cut_main                                            1052    1041     -11
add_edge_to_node                                      55      43     -12
dpkg_main                                           3851    3835     -16
ifupdown_main                                       2202    2178     -24
sort_main                                            838     812     -26
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/15 up/down: 82/-124)          Total: -42 bytes
2008-07-08 05:14:36 +00:00
Denis Vlasenko
a60f84ebf0 *: rename ATTRIBUTE_XXX to just XXX. 2008-07-05 09:18:54 +00:00
Denis Vlasenko
fa0b56db76 sendmail: fix wrong vfork usage here too
*: shorten error texts

function                                             old     new   delta
launch_helper                                          -     151    +151
vfork_or_die                                          20       -     -20
sendgetmail_main                                    1946    1848     -98
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/1 up/down: 151/-118)           Total: 33 bytes
2008-07-01 16:09:07 +00:00
Denis Vlasenko
82604e9730 revert last two commits. vfork cannot be used in subroutine,
it trashes stack on return
2008-07-01 15:59:42 +00:00
Denis Vlasenko
58d60c3333 *: introduce and use xfork()
function                                             old     new   delta
xfork                                                  -      20     +20
msh_main                                            1377    1380      +3
mod_process                                          455     446      -9
forkexit_or_rexec                                     30      17     -13
expand_variables                                    1434    1421     -13
open_transformer                                      91      76     -15
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/4 up/down: 23/-50)            Total: -27 bytes
2008-07-01 11:11:24 +00:00
Denis Vlasenko
3da5572bfa *: introduce and use xvfork()
function                                             old     new   delta
time_main                                           1052    1285    +233
crontab_main                                         623     856    +233
ifupdown_main                                       2202    2403    +201
xvfork                                                 -      20     +20
passwd_main                                         1049    1053      +4
grave                                               1068    1066      -2
script_main                                          935     921     -14
vfork_or_die                                          20       -     -20
vfork_compressor                                     206     175     -31
open_as_user                                         109       -    -109
popen2                                               218       -    -218
edit_file                                            910     690    -220
run_command                                          268       -    -268
------------------------------------------------------------------------------
(add/remove: 1/4 grow/shrink: 4/4 up/down: 691/-882)         Total: -191 bytes
2008-07-01 10:40:41 +00:00
Denis Vlasenko
86d88c0990 bunzip2: make proper fix for the problem "fixed" in rev. 22521
Thanks for Rob Landley <rob@landley.net>
2008-06-28 18:10:09 +00:00
Denis Vlasenko
a60936da06 libunarchive: stop using static data in archivers - archive_handle_t
can trivially provide space for that.
rpm: code shrink
tar: simplify autodetection of bz2/.gz


function                                             old     new   delta
static.not_first                                       1       -      -1
static.end                                             1       -      -1
bb_makedev                                            51      49      -2
static.saved_hardlinks_created                         4       -      -4
static.saved_hardlinks                                 4       -      -4
longname                                               4       -      -4
linkname                                               4       -      -4
hash_file                                            251     247      -4
get_header_tar                                      1528    1521      -7
rpm_main                                            1711    1697     -14
get_header_cpio                                      965     944     -21
------------------------------------------------------------------------------
(add/remove: 0/6 grow/shrink: 0/5 up/down: 0/-66)             Total: -66 bytes
   text    data     bss     dec     hex filename
 804926     611    6868  812405   c6575 busybox_old
 804878     611    6852  812341   c6535 busybox_unstripped
2008-06-28 05:04:09 +00:00
Denis Vlasenko
55da0be405 support gzip -t and bzip2 -t 2008-06-27 21:52:41 +00:00
Denis Vlasenko
bbd55c9ec7 cpio: fix -m to actually work as expected (Pascal Bellard)
function                                             old     new   delta
cpio_main                                           1140    1153     +13
2008-06-27 15:52:07 +00:00
Denis Vlasenko
2bbdda09df unlzma: fix memory leak (Pascal Bellard) 2008-06-27 15:48:45 +00:00
Denis Vlasenko
defc1ea340 *: introduce and use FAST_FUNC: regparm on i386, otherwise no-on
text    data     bss     dec     hex filename
 808035     611    6868  815514   c719a busybox_old
 804472     611    6868  811951   c63af busybox_unstripped
2008-06-27 02:52:20 +00:00
Denis Vlasenko
5fb79535ee bunzip2: fix an uncompression error. Add the example to testsuite. 2008-06-26 20:27:42 +00:00
Denis Vlasenko
f5d8c90d73 style fixes, no code changes 2008-06-26 14:32:57 +00:00
Denis Vlasenko
2649f215ae open_transformer: fix bug of calling exit instead of _exit
open_transformer: don't leak compressed descriptor anymore
recursive_action: tiny shrink
2008-06-26 03:26:57 +00:00
Denis Vlasenko
a04cc47f1c b[un]zip2, g[un]zip: unlink destination if -f is given. Closes 3854 2008-06-25 20:54:45 +00:00
Denis Vlasenko
c87339d584 dpkg: trivial code shrinkage, and redo G trick correctly.
function                                             old     new   delta
run_package_script_or_die                              -      72     +72
fill_package_struct                                  303     309      +6
search_package_hashtable                             122     125      +3
get_status                                           112     111      -1
status_hashtable                                       4       -      -4
set_status                                           162     158      -4
package_hashtable                                      4       -      -4
name_hashtable                                         4       -      -4
package_satisfies_dependency                         112     106      -6
search_name_hashtable                                118     110      -8
configure_package                                    121     106     -15
remove_package                                       333     317     -16
search_status_hashtable                              133     111     -22
purge_package                                        247     217     -30
unpack_package                                       552     521     -31
run_package_script                                    62       -     -62
dpkg_main                                           3991    3867    -124
------------------------------------------------------------------------------
(add/remove: 1/4 grow/shrink: 2/10 up/down: 81/-331)         Total: -250 bytes
   text    data     bss     dec     hex filename
 807972     611    6924  815507   c7193 busybox_old
 807603     611    6908  815122   c7012 busybox_unstripped
2008-06-21 23:15:43 +00:00
Denis Vlasenko
d235f58ac2 dpkg: code shrink
dpkg: add documentation from bug 3644

function                                             old     new   delta
remove_package                                       318     333     +15
unpack_package                                       541     552     +11
purge_package                                        242     247      +5
all_control_list                                      55      53      -2
all_control_files                                     44      40      -4
add_split_dependencies                               709     703      -6
search_status_hashtable                              148     133     -15
search_package_hashtable                             137     122     -15
search_name_hashtable                                134     118     -16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/6 up/down: 31/-58)            Total: -27 bytes
   text    data     bss     dec     hex filename
 808093     611    6924  815628   c720c busybox_old
 807972     611    6924  815507   c7193 busybox_unstripped
2008-06-21 22:46:58 +00:00
Denis Vlasenko
20273138fc dpkg: code shrink (by Peter Korsgaard <jacmet@uclibc.org>)
function                                             old     new   delta
create_list                                          104      86     -18
2008-06-21 22:10:52 +00:00
Denis Vlasenko
d50dda8c35 *: use llist_pop for traverse-and-free list operation
function                                             old     new   delta
append_file_list_to_list                             109     111      +2
udhcpc_main                                         2414    2413      -1
run_parts_main                                       325     324      -1
od_main                                             2324    2323      -1
getopt_main                                          709     707      -2
env_main                                             253     251      -2
sed_main                                             659     656      -3
ps_main                                              522     519      -3
traceroute_main                                     3960    3954      -6
sort_main                                            844     838      -6
diff_main                                            866     858      -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/10 up/down: 2/-33)            Total: -31 bytes
2008-06-15 05:40:56 +00:00
Denis Vlasenko
7a762f9dbf tar: fix "unused parameter 'gzip'" warning 2008-06-14 19:38:35 +00:00
Bernhard Reutner-Fischer
f0d6068086 - The conffiles control file isn't required in Debian packages, so don't
error out if it's missing. (Peter Korsgaard)
2008-06-05 12:18:42 +00:00
Bernhard Reutner-Fischer
5e25ddb7d3 - use STD*_FILENO some more. No object-code changes 2008-05-19 09:48:17 +00:00
Bernhard Reutner-Fischer
636a1f85e8 - use EXIT_{SUCCESS,FAILURE}. No object-code changes 2008-05-19 09:29:47 +00:00
Denis Vlasenko
6b06cb80be more of -Wall fixes from Cristian Ionescu-Idbohrn.
Some are fixing real bugs.

function                                             old     new   delta
syslogd_main                                         938     958     +20
get_signum                                           136     143      +7
obj_load                                             777     782      +5
recv_from_to                                         210     214      +4
get_next_block                                      1795    1799      +4
display_topmem_process_list                         1117    1121      +4
logread_main                                         484     487      +3
buffer_fill_and_print                                 73      76      +3
kill_main                                            687     689      +2
ll_remember_index                                    240     241      +1
do_stats                                             452     453      +1
if_readconf                                          166     165      -1
display_process_list                                1192    1191      -1
run_applet_and_exit                                  507     505      -2
print_signames                                        33      31      -2
parse_one_line                                      1092    1090      -2
find_out_spec                                         57      55      -2
add_ksymoops_symbols                                 421     419      -2
ash_main                                            1407    1402      -5
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 11/8 up/down: 54/-17)            Total: 37 bytes
2008-05-15 21:30:45 +00:00
Denis Vlasenko
77ad97f199 more -Wall warning fixes from Cristian Ionescu-Idbohrn.
This time it resulted in small code changes:

function                                             old     new   delta
nexpr                                                820     828      +8
tail_main                                           1200    1202      +2
wrapf                                                166     167      +1
parse_mount_options                                  227     209     -18
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 11/-18)             Total: -7 bytes
2008-05-13 02:27:31 +00:00
Denis Vlasenko
05efca90d2 tar: fix obscure case when name is "" and prefix is not "" 2008-04-29 04:12:58 +00:00
Denis Vlasenko
d93400bffb tar: fix the case where long base names can be ignored 2008-04-29 03:54:16 +00:00
Denis Vlasenko
c450379ff0 tar: remove bogus check for "-" (we handle it corrently later)
tar: simplify argv handling

function                                             old     new   delta
tar_main                                             772     722     -50
2008-04-29 02:43:23 +00:00
Denis Vlasenko
ffdcb41fd2 build system: typo fix in help text 2008-04-23 05:46:55 +00:00
Denis Vlasenko
5a07a1d255 tar: move vfork into separate function (smaller code)
open_transformer: more informative error messages

function                                             old     new   delta
vfork_compressor                                       -     210    +210
writeTarFile                                         547     299    -248
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 210/-248)          Total: -38 bytes
2008-04-21 21:56:07 +00:00
Denis Vlasenko
bc1918a7a2 trivial fixes to make bbox compile with gcc 4.3.0 2008-04-15 01:17:50 +00:00
Denis Vlasenko
1af00eda92 cpio: fix a bug where we do not extract zero-sized hardlinks
(spotted at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466771).
Add testsuite entry for that, and another one for another bug:
we do not list hardlinks in cpio -t (not fixed).

function                                             old     new   delta
get_header_cpio                                      884     909     +25
static.saved_hardlinks_created                         -       4      +4
static.pending_hardlinks                               4       -      -4
static.inode                                           4       -      -4
cpio_main                                           1122    1060     -62
2008-04-05 02:44:30 +00:00
Denis Vlasenko
1a95e3960c cpio: typo fix in error message 2008-04-05 00:13:19 +00:00
Denis Vlasenko
261f237024 cpio: optional support for writing cpio files in newc format.
by pascal.bellard AT ads-lu.com.

function                                             old     new   delta
cpio_main                                            247    1122    +875
cpio_pad4                                              -      58     +58
gnu_dev_major                                         66      99     +33
gnu_dev_minor                                         38      57     +19
packed_usage                                       23964   23978     +14
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 4/0 up/down: 999/0)             Total: 999 bytes
2008-04-05 00:07:46 +00:00
Denis Vlasenko
5297809c03 g[un]zip: accept and ignore -n (needed for kernel compile) 2008-03-30 13:11:47 +00:00
Denis Vlasenko
2570b2e575 whitespace fixes 2008-03-28 01:00:09 +00:00
Denis Vlasenko
8ee649a02e *: more uniform naming: s/xmalloc_getline/xmalloc_fgetline/ 2008-03-26 20:04:27 +00:00
Denis Vlasenko
c93b162248 patch: shrink by Pascal Bellard <pascal.bellard AT ads-lu.com> (-80 bytes)
*: removal of #include <getopt.h>
2008-03-23 22:55:25 +00:00
Denis Vlasenko
c0183e6e0d unlzma: shrink by Pascal Bellard <pascal.bellard AT ads-lu.com> 2008-03-18 03:13:25 +00:00
Denis Vlasenko
4ee7cd4f6f *: mode tcp/udpsvd to networking, delete ipsvd/*
*/Config.in: fixes to text
svlogd: make it NOMMU capable

function                                             old     new   delta
processorstart                                       378     420     +42
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 42/0)               Total: 42 bytes
   text    data     bss     dec     hex filename
 797153     662    7420  805235   c4973 busybox_old
 797196     662    7420  805278   c499e busybox_unstripped
2008-03-17 09:13:22 +00:00
Denis Vlasenko
85c247161b *: fix fallout from -Wunused-parameter
function                                             old     new   delta
bbunpack                                             358     366      +8
passwd_main                                         1070    1072      +2
handle_incoming_and_exit                            2651    2653      +2
getpty                                                88      86      -2
script_main                                          975     972      -3
inetd_main                                          2036    2033      -3
dname_enc                                            377     373      -4
make_new_session                                     474     462     -12
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/5 up/down: 12/-24)            Total: -12 bytes
   text    data     bss     dec     hex filename
 797429     658    7428  805515   c4a8b busybox_old
 797417     658    7428  805503   c4a7f busybox_unstripped
2008-03-17 09:04:04 +00:00
Denis Vlasenko
68404f13d4 *: add -Wunused-parameter; fix resulting breakage
function                                             old     new   delta
procps_scan                                         1265    1298     +33
aliascmd                                             278     283      +5
parse_file_cmd                                       116     120      +4
dname_enc                                            373     377      +4
setcmd                                                90      93      +3
execcmd                                               57      60      +3
count_lines                                           72      74      +2
process_command_subs                                 340     339      -1
test_main                                            409     407      -2
mknod_main                                           179     177      -2
handle_incoming_and_exit                            2653    2651      -2
argstr                                              1312    1310      -2
shiftcmd                                             131     128      -3
exitcmd                                               46      43      -3
dotcmd                                               297     294      -3
breakcmd                                              86      83      -3
evalpipe                                             353     349      -4
evalcommand                                         1180    1176      -4
evalcmd                                              109     105      -4
send_tree                                            374     369      -5
mkfifo_main                                           82      77      -5
evalsubshell                                         152     147      -5
typecmd                                               75      69      -6
letcmd                                                61      55      -6
add_cmd                                             1190    1183      -7
main                                                 891     883      -8
ash_main                                            1415    1407      -8
parse_stream                                        1377    1367     -10
alloc_procps_scan                                     55       -     -55
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 7/21 up/down: 54/-148)          Total: -94 bytes
   text    data     bss     dec     hex filename
 797195     658    7428  805281   c49a1 busybox_old
 797101     658    7428  805187   c4943 busybox_unstripped
2008-03-17 09:00:54 +00:00
Denis Vlasenko
9f153f610f fsck_minix: getopt32-ification; code shrink; reduce stack usage;
fix bug in map_block2: s/(blknr >= 256 * 256)/(blknr < 256 * 256)/

function                                             old     new   delta
get_inode_common                                       -     291    +291
add_zone_common                                        -     205    +205
ask                                                  229     215     -14
write_super_block                                    109      90     -19
write_block                                          653     629     -24
bad_zone                                              95      64     -31
read_block                                           241     198     -43
fsck_minix_main                                     3285    3195     -90
add_zone2                                            217      34    -183
add_zone                                             216      33    -183
recursive_check                                     1097     866    -231
recursive_check2                                    1340     956    -384
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 0/10 up/down: 496/-1202)       Total: -706 bytes
   text    data     bss     dec     hex filename
 799349     661    7428  807438   c520e busybox_old
 798437     661    7428  806526   c4e7e busybox_unstripped
2008-03-17 08:32:26 +00:00
Denis Vlasenko
444639cc21 unlzma: save a few more bytes, and maybe even a bit faster now 2008-03-02 18:56:23 +00:00
Denis Vlasenko
c3fff877e1 unlzma: if !LZMA_FAST, save ~200 more bytes (Pascal Bellard <pascal.bellard AT ads-lu.com>) 2008-03-02 18:55:49 +00:00
Denis Vlasenko
574f2f4394 *: add optimization barrier to all "G trick" locations 2008-02-27 18:41:59 +00:00
Denis Vlasenko
e7b43cf59f trivial fixes to config system 2008-02-19 23:42:22 +00:00
Denis Vlasenko
431a7c9c53 tar: optional autodetection of gz/bz2 compressed tarballs.
+130 bytes. Closes bug 992.
2008-02-19 11:26:28 +00:00
Denis Vlasenko
b3b0753593 dpkg: fix bug where existence check was reversed 2008-02-17 14:29:25 +00:00
Denis Vlasenko
3718832a15 *: more readable handling of pipe fds. No code changes. 2008-02-16 13:20:56 +00:00
Denis Vlasenko
284d0faed6 random s/short/int/
add_cmd                                             1189    1190      +1
xconnect_ftpdata                                     118     117      -1
data_align                                            86      84      -2
process_files                                       2101    2096      -5
forkexec                                            1345    1334     -11
2008-02-16 13:18:17 +00:00
Denis Vlasenko
e00e5025ec tar: real support for -p. +200 if selected.
By Natanael Copa <natanael.copa at gmail.com>
2008-02-14 20:37:54 +00:00
Denis Vlasenko
12c0622231 tar: do "short EOF" compat only if CONFIG_DESKTOP.
ash: add a comment about new minor bug
2008-02-14 08:52:30 +00:00
Denis Vlasenko
23ffb6a4a2 tar: compat: handle tarballs with only one zero block at the end 2008-02-13 17:52:42 +00:00
Denis Vlasenko
87cf2ee8ab tar: move FNM_LEADING_DIR #define to tar.c - no other users.
Closes bug 1332.
2008-02-13 17:06:53 +00:00
Denis Vlasenko
e8ef7ec7de unzip: do not try to read entire compressed stream at once (it can be huge)
unzip: handle short reads correctly
2008-02-04 12:12:48 +00:00
Denis Vlasenko
847fa779af *: tidy up usage of char **environ 2008-01-28 22:45:43 +00:00
Denis Vlasenko
fb0eba706c libbb: introduce and use safe_waitpid (loops in EINTR)
*: use more approproate (shorter) versions of wait()

function                                             old     new   delta
safe_waitpid                                           -      48     +48
wait_any_nohang                                        -      17     +17
send_tree                                            365     369      +4
processorstop                                        432     435      +3
text_yank                                            110     108      -2
make_human_readable_str                              202     200      -2
crond_main                                          1368    1366      -2
handle_sigchld                                        49      43      -6
reapchild                                            166     159      -7
custom                                               260     250     -10
checkscript                                          191     177     -14
wait_nohang                                           17       -     -17
wait_pid                                              43       -     -43
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 2/7 up/down: 72/-103)           Total: -31 bytes
2008-01-02 19:55:04 +00:00
Denis Vlasenko
abee3d0e0d Fix xmalloc_fgets_str so that it really does NOT strip terminator.
Add xmalloc_fgetline_str which does strip terminator,
and use it in dpkg instead of xmalloc_fgets_str.
netstat: use xmalloc_fgets_str - allows to eat strings with NULs
(this fixes bug with some weird /proc/net/unix input)

function                                             old     new   delta
xmalloc_fgets_internal                                 -     191    +191
xmalloc_fgetline_str                                   -      18     +18
do_info                                              116     120      +4
unix_do_one                                          451     447      -4
tcp_do_one                                           423     419      -4
send_tree                                            369     365      -4
xmalloc_fgets_str                                    178      15    -163
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 1/4 up/down: 213/-175)           Total: 38 bytes
   text    data     bss     dec     hex filename
 778445     832    7344  786621   c00bd busybox_old
 778483     832    7344  786659   c00e3 busybox_unstripped
2007-12-26 20:44:45 +00:00
Denis Vlasenko
f7be20e70c nameif: extended matching (Nico Erfurth <masta@perlgolf.de>)
*: whitespace fixes

function                                             old     new   delta
prepend_new_eth_table                                  -     304    +304
nameif_main                                          620     684     +64
cc_macaddr                                            51       -     -51
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 1/0 up/down: 368/-51)           Total: 317 bytes
2007-12-24 14:09:19 +00:00
Denis Vlasenko
ab801874f8 attack the biggest stack users:
-mkfs_minix_main [busybox_unstripped]:                  4288
-mkfs_minix_main [busybox_unstripped]:                  4276
-grave [busybox_unstripped]:                            4260
(bzip2 users too - not listed)

price we pay in code size increase:
mainSort                                            2458    2515     +57
grave                                               1005    1058     +53
sendMTFValues                                       2177    2195     +18
BZ2_blockSort                                        122     125      +3
mkfs_minix_main                                     3070    3022     -48
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/1 up/down: 131/-48)            Total: 83 bytes
2007-12-02 08:35:37 +00:00
Paul Fox
16aec39ebe add comment clarifying busybox's use of non-standard tar header 2007-11-17 19:11:05 +00:00
Denis Vlasenko
8512862163 tar: fix a case where glibc detects bogus buffer overrun
which is not really there!
2007-11-16 20:35:30 +00:00
Denis Vlasenko
059c91711f open_transformer: do not duplicate "<program> -cf -"
text    data     bss     dec     hex filename
 677858     738    7236  685832   a7708 busybox_old
 677804     738    7236  685778   a76d2 busybox_unstripped
2007-11-12 02:13:12 +00:00
Denis Vlasenko
4bfb84db4e gzip: fix a case where tar xzf fails (we use uninitialized fd) 2007-11-12 01:44:49 +00:00
Denis Vlasenko
e7fca5125a *: remove superfluous "?" in option parsing 2007-11-10 01:32:18 +00:00
Denis Vlasenko
cd0fbb5e77 unzip: hmm... gcc doesn't like ATTRIBUTE_PACKED?? Document that... 2007-11-06 02:16:01 +00:00
Denis Vlasenko
018b155ad9 telnetd: fix problem with zombies (by Paul Fox <pgf@brightstareng.com>)
syslogd: strip trailing NULs
2007-11-06 01:38:46 +00:00
Paul Fox
cb981638f5 change safety check on zip header to allow for extra length, and
revert the header read to use the correct constant rather than
sizeof.  at least one version of gcc (armv4-linux-gcc-3.4.1) pads
the struct to 28 bytes in spite of the packing.
2007-11-05 23:09:03 +00:00
Denis Vlasenko
6cee58e9cf Announce 1.8.0 2007-11-04 15:43:26 +00:00
Denis Vlasenko
6fa3ab3cf1 bzip2: make -d actually work 2007-10-21 18:59:58 +00:00
Denis Vlasenko
fcc569637b unzip: add a comment explaining why we don't die 2007-10-19 21:03:09 +00:00
Denis Vlasenko
bc7c5d082e unzip: fix endianness bugs 2007-10-18 23:27:46 +00:00
Denis Vlasenko
0de37e10ed ash: use fdprintf, not dprintf.
*: trailing whitespace removed
2007-10-17 11:08:53 +00:00
Denis Vlasenko
31acd1ba0a bzip2: more of code shrink
compressStream                                       503     473     -30
BZ2_bzCompress                                        78       -     -78
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-108)           Total: -108 bytes
   text    data     bss     dec     hex filename
 676300    2538   12104  690942   a8afe busybox_old
 676192    2538   12104  690834   a8a92 busybox_unstripped
2007-10-17 10:14:11 +00:00
Denis Vlasenko
686b0ef7d8 bzip2: move state pointer to the offset 0 (smaller code)
ifdef out DecompressEnd if FEATURE_CLEAN_UP is not seleted

fallbackSort                                        1655    1672     +17
mainSort                                            2447    2458     +11
bzip2_main                                           109     119     +10
.rodata                                           123466  123469      +3
generateMTFValues                                    433     435      +2
handle_compress                                      355     356      +1
BZ2_bzCompress                                        79      78      -1
prepare_new_block                                     55      48      -7
compressStream                                       547     503     -44
sendMTFValues                                       2225    2140     -85
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 6/4 up/down: 44/-137)           Total: -93 bytes
   text    data     bss     dec     hex filename
 676421    2538   12104  691063   a8b77 busybox_old
 676328    2538   12104  690970   a8b1a busybox_unstripped
2007-10-16 14:07:41 +00:00
Denis Vlasenko
008eda2c54 bzip2: make -s equivalent to -2 (compatible with standard bzip2)
telnetd: typo fix in comment
2007-10-16 10:47:27 +00:00
Denis Vlasenko
b6ccd32e3f bzip2: implement -1..-9 command line flags 2007-10-14 07:51:19 +00:00
Denis Vlasenko
6a9154b6f6 bzip2: eliminate some divisions 2007-10-14 07:49:48 +00:00
Denis Vlasenko
3f5fdc7572 remove trailing whitespace 2007-10-14 04:55:59 +00:00
Denis Vlasenko
9435993b01 bzip2: code size shrink 2007-10-14 01:37:53 +00:00
Denis Vlasenko
be5a7b9655 bzip2: remove files which are not used anymore 2007-10-14 00:44:10 +00:00