Commit Graph

10242 Commits

Author SHA1 Message Date
Mike Frysinger
dc3bc40578 hush: add support for special vars in braces
Some people like to use ${?} rather than $?, so make sure we support all
the special single char vars that use this form.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-01 14:16:43 -04:00
Mike Frysinger
ff64fb9e31 hush_test: filter test output to avoid C lib differences
The getopt function in some C libraries wraps the option in single quotes
while others do not.  Avoid the issue by running sed on the output and
strip all quotes.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-01 14:16:43 -04:00
Mike Frysinger
f524b6c87f lineedit: fix warning about unused label when VI editing is disabled
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-01 14:16:43 -04:00
Denys Vlasenko
28a105d867 nc, hush: cosmetic cleanups, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-06-01 11:26:30 +02:00
Denys Vlasenko
4b7db4f2ca read_key: drop optimization where we read 3 bytes at once
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-29 10:39:06 +02:00
Denys Vlasenko
171932d7ca hust: trivial simplification in builtin_type
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-28 17:07:22 +02:00
Denys Vlasenko
e640cb4ad1 hush: fix bug 353 (wrong handling of \x in assignments)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-28 16:49:11 +02:00
Denys Vlasenko
5d7cca2090 hush: optimize type builtin a bit more
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-28 09:58:43 +02:00
Denys Vlasenko
dd6b211921 hush: optimize type builtin a bit
function                                             old     new   delta
builtin_type                                         130     125      -5

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-28 09:45:50 +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
f3cbfc0e2c modprobe: fix more bugs in modprobe -r
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-28 03:54:29 +02:00
Denys Vlasenko
398c659970 cpio.tests: fix false positive
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-28 02:03:29 +02:00
Mike Frysinger
93cadc2fdd hush: implement type
Implement support for the POSIX `type` command.  Only POSIX stuff is
supported here, no bash extensions like -p or -P.

In the process, split the $PATH searching code out of builtin_source() and
into its own find_in_path() function so we don't duplicate it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-27 17:06:25 -04:00
Denys Vlasenko
673e945052 hush: remove outdated TODO and superfluous macro; fix compile breakage
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-27 14:39:35 +02:00
David Krakov
29ec116037 POSIX conformance documentation for busybox
Attached a start for POSIX conformance documentation for busybox (see
TODO file and discussion last week).
A table of all options as defined by POSIX and as implemented by
busybox (see for a FreeBSD example
http://people.freebsd.org/~schweikh/posix-utilities.html).

Only the tools that are stand-alone applets are documented (not ash
built-ins as 'read'), as there are multiple shells.
When there are two versions (echo) the stand-alone version was
checked. I think this may be the wrong way to go, as most users will
probably use the built-in version - but which shell?

The table was auto-generated by running, for each POSIX utility,
latest git allyesconfig* "busybox <tool> --help" and parsing the
output, and comparing that to tool options extracted from its man page
at http://www.opengroup.org/onlinepubs/9699919799/.
This means that it the usage string is not correct, the table is also
wrong. I noticed that for 'kill', for example, the usage string does
not mention the -s, -q, -o options.
For each option is set whether it exists in busybox and if it is, is
it compliant to the standard. Of course, checking compliance can only
be done manually - a process which will probably take some time (see
'cat' for example).

I didn't post the auto-generation script (python, ugly) because the
table will now change manually; I can post it if there is anyone
interested.

As for the tools not implemented by busybox at all, I think most of
them are indeed fairly esotetic. Some I was suprised to see missing
are link, file, newgrp, unlink.

* Well, almost allyesconfig - but nothing very POSIX-y was disabled.

Signed-off-by: David Krakov <krakov@gmail.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-26 19:42:34 -04:00
Denys Vlasenko
68759edb6e hush: tweak comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-26 14:39:41 +02:00
Denys Vlasenko
e2df5f46d0 hush: rename last_waitpid_was_0 to we_have_children
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-26 14:34:10 +02:00
Denys Vlasenko
140def848c modprobe: fix modprobe -r. closes bug 315
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-26 12:48:34 +02:00
Denys Vlasenko
8d7be232a3 hush: fix SIGCHLD counting code, but keep it disabled for now.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-25 16:38:32 +02:00
Denys Vlasenko
bf2af9acb2 flash_lock, flash_unlock: new applets
By Thierry Reding (thierry.reding AT avionic-design.de)

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-25 04:15:37 +02:00
Denys Vlasenko
4f26c97b9a make compound.tests executable
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-23 17:00:13 +02:00
Denys Vlasenko
e9bda90e54 hush: fix problems with case in subshells and with "case esac"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-23 16:50:07 +02:00
Mike Frysinger
342a63d659 hush_test: add some pathological compound list tests
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-21 18:35:37 -04:00
Mike Frysinger
12bcc76e9b hush_test: test for subshell function syntax
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-21 18:35:08 -04:00
Mike Frysinger
7b424fe738 hush_test: add subshelled case tests
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-21 18:09:24 -04:00
Mike Frysinger
cc9205bda7 hush_test: update test output to match new getopt() output
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-21 17:58:15 -04:00
Mike Frysinger
33f85eeac5 hush_test: ignore generated files
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-21 17:45:26 -04:00
Denys Vlasenko
2b132e5139 hdparm: fix a thinko in a previous commit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-20 23:21:42 +02:00
Denys Vlasenko
d8aeba4eed Merge branch 'master' of git+ssh://vda@busybox.net/var/lib/git/busybox 2009-05-20 21:50:29 +02:00
Denys Vlasenko
c706845539 hdparm: code shrink
function                                             old     new   delta
parse_opts_0_INTMAX                                    -      12     +12
parse_opts_0_1                                         -      12     +12
parse_opts_0_max                                       -       9      +9
parse_opts                                            44      36      -8
process_dev                                         4679    4578    -101
hdparm_main                                         1061     854    -207
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 0/3 up/down: 33/-316)          Total: -283 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-20 16:11:41 +02:00
Denys Vlasenko
6d335be211 hdparm: correct (t & 1) ? '0' : '5' thinko; wrap 80+ col lines
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-20 14:48:03 +02:00
Denys Vlasenko
73f3799236 Merge branch 'master' of git+ssh://vda@busybox.net/var/lib/git/busybox 2009-05-20 14:10:50 +02:00
Denys Vlasenko
e18255d1da Merge branch 'master' of git+ssh://vda@busybox.net/var/lib/git/busybox 2009-05-20 12:20:48 +02:00
Mike Frysinger
38478a600f hush: fix build failure when jobs are disabled
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reported-by: Thomas Chou <thomas@wytron.com.tw>
2009-05-20 04:48:06 -04:00
Denys Vlasenko
0149f02a72 appletlib.c: prevent applet list overflowing screen
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-19 18:01:42 +02:00
Denys Vlasenko
5e61115ea4 scriptreplay: new applet. +423 bytes
Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-19 17:36:16 +02:00
Denys Vlasenko
5a49d284a6 add platform tweaks
login: consider platforms having no domainname field in the utsname struct
include/platform.h: define IUCLC to 0 on platforms where it is not defined

Signed-off-by: Luca Favatella <slackydeb@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-19 13:18:45 +02:00
Denys Vlasenko
e424423a7b awk: put at least one NUL between $n. Hopefully closes 337.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-18 23:50:03 +02: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
Denys Vlasenko
16bda3bd1f depmod: fix handling of .gz modules
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-18 13:08:04 +02:00
Denys Vlasenko
c396fe6306 lineedit: small fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-17 19:28:14 +02:00
Denys Vlasenko
020f40693a line editing: add an option to emit ESC [ 6 n and use results
This makes line editing able to recognize case when
cursor was not at the beginning of the line. It may also
be adapted later to find out display size (serial line users
would love it).

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-17 16:44:54 +02:00
Denys Vlasenko
071ede1e5d xmalloc_[open_]read[_close]: do not ignore xrealloc return value
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-15 23:23:23 +02:00
Denys Vlasenko
c15f40c3e7 lineedit: use read_key to recognize ESC sequence.
This fixes several vi mode bugs and prepares for further fixes.

function                                             old     new   delta
read_line_input                                     3287    5511   +2224
remember_in_history                                    -     499    +499
lineedit_read_key                                      -      70     +70
read_key                                             321     332     +11
input_tab                                           2823       -   -2823
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 2/0 up/down: 2804/-2823)        Total: -19 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-15 03:27:53 +02:00
Denys Vlasenko
1b0a93edb9 adduser/addgroup: make system id range configurable.
By Tito (farmatito AT tiscali.it).

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-14 00:23:34 +02:00
Denys Vlasenko
810b7161dc mount: save 80 bytes by forced de-inlining
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-13 23:48:59 +02:00
Denys Vlasenko
e71dd7c1db mount: document when kernel started accepting string as NFS options
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-13 16:32:32 +02:00
Mike Frysinger
7a5814c74c split website off into dedicated git repo
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-13 01:48:00 -04:00
Denys Vlasenko
318a8e5ed5 TODO: add some
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-05-13 02:18:43 +02:00
Bernhard Reutner-Fischer
845142e106 Adjust names, link contributing info in main index
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-05-11 22:51:49 +02:00