platform/upstream/toybox.git
11 years agoHave error_msg() and friends set TT.exitval to 1 if it's still 0, clean out other...
Rob Landley [Wed, 2 Jan 2013 08:00:35 +0000 (02:00 -0600)]
Have error_msg() and friends set TT.exitval to 1 if it's still 0, clean out other places that were setting it that no longer need to.

11 years agoMake dirtree_handle_callback() start with dirtree_ like the rest of the dirtree funct...
Rob Landley [Mon, 31 Dec 2012 20:38:13 +0000 (14:38 -0600)]
Make dirtree_handle_callback() start with dirtree_ like the rest of the dirtree functions.

11 years agoAdd losetup. (Who knows, it might even work.)
Rob Landley [Mon, 31 Dec 2012 03:35:01 +0000 (21:35 -0600)]
Add losetup. (Who knows, it might even work.)

11 years agoFix invalid free in toysh.
Felix Janda [Sun, 30 Dec 2012 10:53:27 +0000 (11:53 +0100)]
Fix invalid free in toysh.

11 years agoGetting the pwd -L behavior right is fiddly.
Rob Landley [Sun, 30 Dec 2012 10:43:11 +0000 (04:43 -0600)]
Getting the pwd -L behavior right is fiddly.

11 years agoAdd some tests for pwd.
Felix Janda [Fri, 28 Dec 2012 21:10:21 +0000 (22:10 +0100)]
Add some tests for pwd.

11 years agoAdd options -L and -P to pwd.
Felix Janda [Thu, 27 Dec 2012 16:56:39 +0000 (17:56 +0100)]
Add options -L and -P to pwd.

11 years agoAshwini Sharma pointed out that my previous tweak to [!abc] groups still didn't get...
Rob Landley [Sat, 29 Dec 2012 09:18:34 +0000 (03:18 -0600)]
Ashwini Sharma pointed out that my previous tweak to [!abc] groups still didn't get the error reporting right (test case "touch -d 12 -r f2 f1"). This says "no 'r' with 'd'" for that, and still shouldn't be able to fall off the end of the list (segfault) because an option can't conflict with itself (that's what the ~(1<<i) on lib/args.c line 317 is for).

11 years agoAdd tests to mkfifo based on tests for mkdir.
Felix Janda [Thu, 27 Dec 2012 16:55:21 +0000 (17:55 +0100)]
Add tests to mkfifo based on tests for mkdir.

11 years agomkfifo -m is already implemented.
Felix Janda [Thu, 27 Dec 2012 16:52:14 +0000 (17:52 +0100)]
mkfifo -m is already implemented.

11 years agoFix option grouping.
Rob Landley [Fri, 28 Dec 2012 00:44:37 +0000 (18:44 -0600)]
Fix option grouping.

11 years agoTOYBOX_DEBUG warns about lack of suid bit when running a STAYROOT command, but it...
Rob Landley [Thu, 27 Dec 2012 23:09:17 +0000 (17:09 -0600)]
TOYBOX_DEBUG warns about lack of suid bit when running a STAYROOT command, but it shouldn't warn just because the multiplexer command "toybox" is stayroot.

11 years agoA screen width of 1 is possible (in some weird setups), and gives ls -C a division...
Rob Landley [Thu, 27 Dec 2012 01:39:51 +0000 (19:39 -0600)]
A screen width of 1 is possible (in some weird setups), and gives ls -C a division by zero error.

11 years agoMinor cleanups.
Rob Landley [Sun, 23 Dec 2012 21:07:28 +0000 (15:07 -0600)]
Minor cleanups.

11 years agoLSB does not allow killall to kill itself
Elie De Brauwer [Sun, 16 Dec 2012 15:51:30 +0000 (16:51 +0100)]
LSB does not allow killall to kill itself

11 years agoMinor tweaks.
Rob Landley [Sun, 23 Dec 2012 20:06:17 +0000 (14:06 -0600)]
Minor tweaks.

11 years agoAdd some tests for mkdir
Felix Janda [Sun, 23 Dec 2012 16:44:35 +0000 (17:44 +0100)]
Add some tests for mkdir

11 years agoAdd -m option to mkdir
Felix Janda [Sun, 23 Dec 2012 15:25:31 +0000 (16:25 +0100)]
Add -m option to mkdir

11 years agoExtend killall with support for -v and -i
Elie De Brauwer [Sun, 16 Dec 2012 12:43:36 +0000 (13:43 +0100)]
Extend killall with support for -v and -i

11 years agoElie De Brauwer pointed out that xputs() isn't reliably reporting errors because...
Rob Landley [Sun, 23 Dec 2012 07:25:27 +0000 (01:25 -0600)]
Elie De Brauwer pointed out that xputs() isn't reliably reporting errors because there's no flush. Rather than change the output granularity, flush before exit and check errors there. (We still need xputc() doing it so "yes" doesn't continue forever.)

11 years agoWhitespace.
Rob Landley [Sun, 23 Dec 2012 07:21:01 +0000 (01:21 -0600)]
Whitespace.

11 years agoExtend seq to support -f (format string) and -s (string separator) as requested by LSB
Elie De Brauwer [Sun, 16 Dec 2012 16:58:25 +0000 (17:58 +0100)]
Extend seq to support -f (format string) and -s (string separator) as requested by LSB

11 years agoFix tac to handle the "abc\ndef" case properly
Elie De Brauwer [Sat, 22 Dec 2012 10:50:11 +0000 (11:50 +0100)]
Fix tac to handle the "abc\ndef" case properly

11 years agoUpdate mkstatus.py, roadmap.html, and status.html.
Rob Landley [Sun, 23 Dec 2012 06:37:42 +0000 (00:37 -0600)]
Update mkstatus.py, roadmap.html, and status.html.

11 years agoRefactoring broke rev
Elie De Brauwer [Sat, 22 Dec 2012 10:44:21 +0000 (11:44 +0100)]
Refactoring broke rev

11 years agoWeb page update for release.
Rob Landley [Wed, 19 Dec 2012 15:16:45 +0000 (09:16 -0600)]
Web page update for release.

11 years agoMinor cleanups.
Rob Landley [Wed, 19 Dec 2012 15:16:27 +0000 (09:16 -0600)]
Minor cleanups.

11 years agoAdding implementation of rev including tests
Elie De Brauwer [Sun, 16 Dec 2012 11:31:15 +0000 (12:31 +0100)]
Adding implementation of rev including tests

11 years agoAdding tests for tac based on cat tests
Elie De Brauwer [Sat, 15 Dec 2012 18:51:43 +0000 (19:51 +0100)]
Adding tests for tac based on cat tests

11 years agoSimplify tac, the newline checking is already done in the get_line() function
Elie De Brauwer [Sat, 15 Dec 2012 18:28:29 +0000 (19:28 +0100)]
Simplify tac, the newline checking is already done in the get_line() function

11 years agoMissing letter in help text.
Rob Landley [Sun, 16 Dec 2012 21:27:33 +0000 (15:27 -0600)]
Missing letter in help text.

11 years agoAdded tag 0.4.2 for changeset 8947c0d35e58
Rob Landley [Sat, 15 Dec 2012 18:29:43 +0000 (12:29 -0600)]
Added tag 0.4.2 for changeset 8947c0d35e58

11 years agoThe Linux kernel "make clean" calls rm -f with no arguments, which apparently is... 0.4.2
Rob Landley [Thu, 13 Dec 2012 03:13:12 +0000 (21:13 -0600)]
The Linux kernel "make clean" calls rm -f with no arguments, which apparently is not an error.

11 years agoAdd stat submission to new "pending" directory, along with infrastructure to support...
Rob Landley [Tue, 11 Dec 2012 03:08:42 +0000 (21:08 -0600)]
Add stat submission to new "pending" directory, along with infrastructure to support pending.

11 years agoessat's flag not to follow symlinks isn't in the system call, and if libc is supposed...
Rob Landley [Mon, 10 Dec 2012 07:48:02 +0000 (01:48 -0600)]
essat's flag not to follow symlinks isn't in the system call, and if libc is supposed to implement this as a wrapper uClibc gets it wrong. So use the stat info about symlinks instead. (Doesn't check the parent directory, but if that's read only we can't delete the file anyway so prompting is moot.)

11 years agoMeddle.
Rob Landley [Sun, 9 Dec 2012 19:57:04 +0000 (13:57 -0600)]
Meddle.

The <1 has to come first in the option string, normalize whitespace,
sprintf of %d maxes out at -2 billion ala 12 bytes with null terminator so
we don't need a length check in a 4k buffer, use the "%*s" feature of printf
to prepend whitespace for us, take advantage of c99 defining ! to return 0 or 1.

11 years agoAdding -s (single shot) and -o (omit pids) options to pidof
Elie De Brauwer [Sat, 8 Dec 2012 19:10:05 +0000 (20:10 +0100)]
Adding -s (single shot) and -o (omit pids) options to pidof

11 years agoSet executable bits on two test scripts.
Rob Landley [Sun, 9 Dec 2012 19:20:16 +0000 (13:20 -0600)]
Set executable bits on two test scripts.

11 years agoAdding sha1sum tests based on RFC 3174
Elie De Brauwer [Sat, 8 Dec 2012 13:40:17 +0000 (14:40 +0100)]
Adding sha1sum tests based on RFC 3174

11 years agoAdding tests for cat
Elie De Brauwer [Sat, 8 Dec 2012 12:28:40 +0000 (13:28 +0100)]
Adding tests for cat

11 years agoAdd README file to each toys/ directory, teach build infrastructure to get fancy...
Rob Landley [Sun, 9 Dec 2012 03:10:10 +0000 (21:10 -0600)]
Add README file to each toys/ directory, teach build infrastructure to get fancy name from that. This means adding new directories shouldn't require touching build scripts.

11 years agoComplicate the rm -i behavior to do what posix specifies.
Rob Landley [Sat, 8 Dec 2012 08:26:56 +0000 (02:26 -0600)]
Complicate the rm -i behavior to do what posix specifies.

11 years agoMake yesno() always read from stdin and write to stderr. (If we need to find our...
Rob Landley [Sat, 8 Dec 2012 08:25:32 +0000 (02:25 -0600)]
Make yesno() always read from stdin and write to stderr. (If we need to find our tty, open /dev/tty, but existing users don't.)

11 years agoNew rm command.
Rob Landley [Fri, 7 Dec 2012 12:26:21 +0000 (06:26 -0600)]
New rm command.

11 years agoUpdate link to posix in docs (open group broke their website).
Rob Landley [Thu, 6 Dec 2012 21:15:30 +0000 (15:15 -0600)]
Update link to posix in docs (open group broke their website).

11 years agoHave dirtree_add_node() set parent so error message can provide full path.
Rob Landley [Thu, 6 Dec 2012 21:13:30 +0000 (15:13 -0600)]
Have dirtree_add_node() set parent so error message can provide full path.

11 years agoUse sched_{set,get}affinity directly so musl doesn't have to provide wrappers.
Rob Landley [Mon, 3 Dec 2012 22:16:06 +0000 (16:16 -0600)]
Use sched_{set,get}affinity directly so musl doesn't have to provide wrappers.

11 years agoMinor whitespace tweak.
Rob Landley [Sun, 2 Dec 2012 00:30:48 +0000 (18:30 -0600)]
Minor whitespace tweak.

11 years agoFirst guess at what internationalization support for expand would look like.
Rob Landley [Sun, 2 Dec 2012 00:30:20 +0000 (18:30 -0600)]
First guess at what internationalization support for expand would look like.

11 years agoGenerate status page with new pubs.opengroup.org urls.
Rob Landley [Sun, 2 Dec 2012 00:27:37 +0000 (18:27 -0600)]
Generate status page with new pubs.opengroup.org urls.

11 years agoRemove unused structure definition.
Rob Landley [Sun, 2 Dec 2012 00:26:58 +0000 (18:26 -0600)]
Remove unused structure definition.

11 years agoThe open group changed their website stupidly, so opengroup.org/onlinepubs forwards...
Rob Landley [Sun, 2 Dec 2012 00:26:21 +0000 (18:26 -0600)]
The open group changed their website stupidly, so opengroup.org/onlinepubs forwards to a dead server and you have to use pubs.opengroup.org/onlinepubs now. Change the hello template to note the new location. (Waiting to see if they fix it upstream before touching every command in toys/posix.)

11 years agoAdd header that musl libc needs.
Rob Landley [Sun, 2 Dec 2012 00:12:06 +0000 (18:12 -0600)]
Add header that musl libc needs.

11 years agoFix ancient glibc workaround to force fstatat64
Rob Landley [Sat, 1 Dec 2012 23:59:38 +0000 (17:59 -0600)]
Fix ancient glibc workaround to force fstatat64

11 years agoMinor cleanup: unify two codepaths that do the same thing.
Rob Landley [Sat, 1 Dec 2012 17:03:52 +0000 (11:03 -0600)]
Minor cleanup: unify two codepaths that do the same thing.

11 years agoWould the compiler like to warn me about declaring two variables with the same name...
Rob Landley [Sat, 1 Dec 2012 16:53:03 +0000 (10:53 -0600)]
Would the compiler like to warn me about declaring two variables with the same name in the same function? No? Carry on then...

11 years agoFelix Janda pointed out that the r in mbrtowc() stands for "restartable" so it's...
Rob Landley [Sat, 1 Dec 2012 06:42:01 +0000 (00:42 -0600)]
Felix Janda pointed out that the r in mbrtowc() stands for "restartable" so it's already buffering the partial data we feed it, so rolling back most of the last commit to wc.

11 years agoRe-add backspace support to expand (oops) and fix test to expect data plus backspace...
Rob Landley [Sat, 1 Dec 2012 06:21:37 +0000 (00:21 -0600)]
Re-add backspace support to expand (oops) and fix test to expect data plus backspace characters rather than the chracters cancelling each other out before output.

11 years agoLargeish rewrite of expand, mostly described on the mailing list.
Rob Landley [Fri, 30 Nov 2012 08:41:52 +0000 (02:41 -0600)]
Largeish rewrite of expand, mostly described on the mailing list.

11 years agomd5sum tests from RFC 1321
Rob Landley [Thu, 29 Nov 2012 04:56:16 +0000 (22:56 -0600)]
md5sum tests from RFC 1321

11 years agoUse the specified compiler for preprocessing.
Rob Landley [Thu, 29 Nov 2012 02:44:52 +0000 (20:44 -0600)]
Use the specified compiler for preprocessing.

11 years agoThe previous wc -m didn't handle multibyte characters that crossed a buffer boundary...
Rob Landley [Wed, 28 Nov 2012 09:12:02 +0000 (03:12 -0600)]
The previous wc -m didn't handle multibyte characters that crossed a buffer boundary, so take a guess at making that work. (I haven't got a test case for this. I also don't know how to handle invalid sequences so just don't count them.)

11 years agologin: Avoid gcc to drop exit condition because of "always false condition".
Jonathan Clairembault [Tue, 27 Nov 2012 10:09:04 +0000 (11:09 +0100)]
login: Avoid gcc to drop exit condition because of "always false condition".

11 years agoFirst round of expand cleanups.
Rob Landley [Tue, 27 Nov 2012 19:55:57 +0000 (13:55 -0600)]
First round of expand cleanups.

11 years agoexpand: handle backspace.
Jonathan Clairembault [Fri, 23 Nov 2012 08:24:53 +0000 (09:24 +0100)]
expand: handle backspace.

11 years agoAdd expand command as described in POSIX-2008.
Jonathan Clairembault [Thu, 22 Nov 2012 23:06:28 +0000 (00:06 +0100)]
Add expand command as described in POSIX-2008.
Erratum: Do not handle backspace.

11 years agoSquash "type punned pointer" nonsense with a bigger hammer. (Sheesh.)
Rob Landley [Tue, 27 Nov 2012 05:36:25 +0000 (23:36 -0600)]
Squash "type punned pointer" nonsense with a bigger hammer. (Sheesh.)

11 years agoThe headers of uClibc and older glibc got unhappy with O_DIRECTORY and some other...
Rob Landley [Tue, 27 Nov 2012 05:24:07 +0000 (23:24 -0600)]
The headers of uClibc and older glibc got unhappy with O_DIRECTORY and some other stuff. Fix it up in portability.h.

11 years agoCleanup i18n support (#ifdefectomy, move global init to process launch). Teach make...
Rob Landley [Mon, 26 Nov 2012 20:14:29 +0000 (14:14 -0600)]
Cleanup i18n support (#ifdefectomy, move global init to process launch). Teach make.sh to emit "#define FLAG_x 0" for options inside disabled USE macros so we can unconditionally refer to them.

11 years agoUpdate touch: add remaining posix arguments, make existing ones work.
Rob Landley [Mon, 26 Nov 2012 01:23:10 +0000 (19:23 -0600)]
Update touch: add remaining posix arguments, make existing ones work.

11 years agoMake internalization support optional
Felix Janda [Wed, 21 Nov 2012 19:38:29 +0000 (20:38 +0100)]
Make internalization support optional

11 years agoFix typo.
Rob Landley [Sun, 25 Nov 2012 20:40:25 +0000 (14:40 -0600)]
Fix typo.

11 years agoRemove readlink -m for being poorly defined ("readlink -m /dev/null/and/more" answers...
Rob Landley [Fri, 23 Nov 2012 03:18:09 +0000 (21:18 -0600)]
Remove readlink -m for being poorly defined ("readlink -m /dev/null/and/more" answers what question, exactly?), rewrite xabspath() to work right and not depend on realpath, fix subtle longstanding bug in llist_traverse().

11 years agoUpdate readlink so -f works. Add -menq while there.
Rob Landley [Tue, 20 Nov 2012 15:21:52 +0000 (09:21 -0600)]
Update readlink so -f works. Add -menq while there.

11 years agoCommit 698 adding cut should ahve included the actual cut.c file. (Oops.)
Rob Landley [Tue, 20 Nov 2012 07:00:17 +0000 (01:00 -0600)]
Commit 698 adding cut should ahve included the actual cut.c file. (Oops.)

11 years agoTeach option parsing about [groups] of related options.
Rob Landley [Mon, 19 Nov 2012 07:49:53 +0000 (01:49 -0600)]
Teach option parsing about [groups] of related options.

11 years agoInit global context to toybox multiplexer early so error_exit() doesn't segfault...
Rob Landley [Mon, 19 Nov 2012 00:52:19 +0000 (18:52 -0600)]
Init global context to toybox multiplexer early so error_exit() doesn't segfault trying to print current command name, and change TOYBOX_DEBUG+TOYBOX_SUID complaint about not having the suid bit set to warning rather than exit..

11 years agoFix leak (call endmntent).
Rob Landley [Sun, 18 Nov 2012 04:06:00 +0000 (22:06 -0600)]
Fix leak (call endmntent).

11 years agoMore touch cleanup to use generic infrastructure: use getdate() from libc, use flag...
Rob Landley [Sat, 17 Nov 2012 00:01:35 +0000 (18:01 -0600)]
More touch cleanup to use generic infrastructure: use getdate() from libc, use flag macros, option parsing can collect argument strings in global block, use existing perror_* macros.

11 years agoFix touch warnings (unused variables, failure to reserve space for null terminator).
Rob Landley [Fri, 16 Nov 2012 21:44:45 +0000 (15:44 -0600)]
Fix touch warnings (unused variables, failure to reserve space for null terminator).

11 years agoRefactor touch (cleanup whitespace, brackets, function order), code otherwise same.
Rob Landley [Fri, 16 Nov 2012 21:36:01 +0000 (15:36 -0600)]
Refactor touch (cleanup whitespace, brackets, function order), code otherwise same.

11 years agoAdd touch from Choubey Ji.
Rob Landley [Fri, 16 Nov 2012 18:43:41 +0000 (12:43 -0600)]
Add touch from Choubey Ji.

11 years agoAdd cut from Jason Kyungwan Han.
Rob Landley [Fri, 16 Nov 2012 18:26:48 +0000 (12:26 -0600)]
Add cut from Jason Kyungwan Han.

11 years agoSet optc when optstring NULL.
Rob Landley [Fri, 16 Nov 2012 06:46:39 +0000 (00:46 -0600)]
Set optc when optstring NULL.

11 years agoAdd rebound support to intercept error_exit() and longjmp instead.
Rob Landley [Fri, 16 Nov 2012 06:35:46 +0000 (00:35 -0600)]
Add rebound support to intercept error_exit() and longjmp instead.

11 years agoMake ls default to -C if no option specified and it's outputting to a tty.
Rob Landley [Thu, 15 Nov 2012 22:15:51 +0000 (16:15 -0600)]
Make ls default to -C if no option specified and it's outputting to a tty.

11 years agoReindent to two spaces per level. Remove vi: directives that haven't worked right...
Rob Landley [Tue, 13 Nov 2012 23:14:08 +0000 (17:14 -0600)]
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.

The actual code should be the same afterward, this is just cosmetic refactoring.

11 years agoAnnounce release, add anchor tags to roadmap, tweak downloads in header (new bin...
Rob Landley [Tue, 13 Nov 2012 22:13:45 +0000 (16:13 -0600)]
Announce release, add anchor tags to roadmap, tweak downloads in header (new bin directory pointing to downloads/binaries/$CURRENT).

11 years agoAdded tag 0.4.1 for changeset 8871e8002812
Rob Landley [Tue, 13 Nov 2012 13:33:05 +0000 (07:33 -0600)]
Added tag 0.4.1 for changeset 8871e8002812

11 years agoOlder versions of glibc predated posix-2008. They still provide most of what we need... 0.4.1
Rob Landley [Tue, 13 Nov 2012 12:32:03 +0000 (06:32 -0600)]
Older versions of glibc predated posix-2008. They still provide most of what we need, but require a boot to the headers to get them to admit it. Note that uClibc lies and claims to be glibc so we have to specifically exclude it here.

11 years agoYet another attempt to get the fiddly patch file creation logic right.
Rob Landley [Mon, 12 Nov 2012 08:59:56 +0000 (02:59 -0600)]
Yet another attempt to get the fiddly patch file creation logic right.

11 years agoOn 32 bit platforms %ld doesn't match uint64_t, so do long long and %lld (rather...
Rob Landley [Sun, 11 Nov 2012 00:24:14 +0000 (18:24 -0600)]
On 32 bit platforms %ld doesn't match uint64_t, so do long long and %lld (rather than deal with verbose PRIu64 nonsense).

11 years agoFix reversed test: patch creates a file if /dev/null or dated the epoch _and_ first...
Rob Landley [Sat, 10 Nov 2012 20:34:01 +0000 (14:34 -0600)]
Fix reversed test: patch creates a file if /dev/null or dated the epoch _and_ first hunk being replaced is 0 lines at start of file, not one or the other.

11 years agoChange df percentage calculation to match posix, spotted by Roy Tam.
Rob Landley [Thu, 8 Nov 2012 21:03:03 +0000 (15:03 -0600)]
Change df percentage calculation to match posix, spotted by Roy Tam.

11 years agowc -m only cares about counting characters. Attached is a try on implementing it...
Felix Janda [Thu, 8 Nov 2012 17:19:07 +0000 (11:19 -0600)]
wc -m only cares about counting characters. Attached is a try on implementing it and some test cases for it. The test cases are only for UTF-8 locales.

11 years agoMake sha1sum and md5sum default to y.
Rob Landley [Sun, 4 Nov 2012 00:21:59 +0000 (19:21 -0500)]
Make sha1sum and md5sum default to y.

11 years agoUse stridx.
Rob Landley [Fri, 2 Nov 2012 14:50:09 +0000 (09:50 -0500)]
Use stridx.

11 years agoAdd vconfig.c - Creates virtual ethernet devices.
Kyungwan Han [Thu, 1 Nov 2012 14:55:29 +0000 (09:55 -0500)]
Add vconfig.c - Creates virtual ethernet devices.

11 years agoattached are some simple tests for dirname and wc and a fix for a small typo in anoth...
Felix Janda [Mon, 29 Oct 2012 21:55:08 +0000 (16:55 -0500)]
attached are some simple tests for dirname and wc and a fix for a small typo in another test script.

11 years agoFollow symlinks to get actual device name, getmountlist() reverses order for us now...
Rob Landley [Sat, 27 Oct 2012 02:15:31 +0000 (21:15 -0500)]
Follow symlinks to get actual device name, getmountlist() reverses order for us now, detect stdout to full device.