OSDN Git Service

android-x86/external-toybox.git
6 years agoMerge remote-tracking branch 'toybox/master' into HEAD
Elliott Hughes [Mon, 19 Jun 2017 19:47:01 +0000 (12:47 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD

Change-Id: If21b4f8a327f584912c9021d9792031e6d79c065

6 years agoManually inline TOP_COMMON and PGKILL_COMMON help text until I can teach
Rob Landley [Mon, 19 Jun 2017 12:51:58 +0000 (07:51 -0500)]
Manually inline TOP_COMMON and PGKILL_COMMON help text until I can teach
the help infrastructure to handle it.

(The lifetime rules are all wrong for hunks that get reused. Needs a largeish
rewrite.)

6 years agoGrep exits with 2 for errors, which can happen at any time ( > /dev/full).
Rob Landley [Wed, 14 Jun 2017 16:23:01 +0000 (11:23 -0500)]
Grep exits with 2 for errors, which can happen at any time ( > /dev/full).

6 years agoconfig2help.c: Rename trim() to skip_spaces(), fluff out comments a bit.
Rob Landley [Tue, 13 Jun 2017 21:33:13 +0000 (16:33 -0500)]
config2help.c: Rename trim() to skip_spaces(), fluff out comments a bit.

6 years agoAdd grep -M match and -S skip supporting wildcard patterns.
Rob Landley [Mon, 12 Jun 2017 16:26:07 +0000 (11:26 -0500)]
Add grep -M match and -S skip supporting wildcard patterns.

They don't imply -r because you might do find . -type f | xargs -S blah regex

6 years agoTwitter's code of conduct page went down, so mirror the old archive.org version.
Rob Landley [Sun, 11 Jun 2017 20:39:03 +0000 (15:39 -0500)]
Twitter's code of conduct page went down, so mirror the old archive.org version.
Move link from README to header.html menu bar.

6 years agoProvide error messages for files we can open but not read (ala directories).
Rob Landley [Sun, 11 Jun 2017 17:23:00 +0000 (12:23 -0500)]
Provide error messages for files we can open but not read (ala directories).

6 years agoFix bug where grep stopped at first dangling symlink and error_exited().
Rob Landley [Sat, 10 Jun 2017 18:17:31 +0000 (13:17 -0500)]
Fix bug where grep stopped at first dangling symlink and error_exited().

6 years agoPromote dmesg back to lsb.
Rob Landley [Fri, 9 Jun 2017 20:01:07 +0000 (15:01 -0500)]
Promote dmesg back to lsb.

6 years agoCleanup dmesg (as posted to the list).
Rob Landley [Fri, 9 Jun 2017 19:59:51 +0000 (14:59 -0500)]
Cleanup dmesg (as posted to the list).

6 years agoAdd comment explaining strend()
Rob Landley [Tue, 6 Jun 2017 18:21:03 +0000 (13:21 -0500)]
Add comment explaining strend()

6 years agoHave help_exit() give a brief "See %s --help" message instead of the
Rob Landley [Tue, 6 Jun 2017 02:22:02 +0000 (21:22 -0500)]
Have help_exit() give a brief "See %s --help" message instead of the
full help text, and put it back in the args constraint failures.

6 years agoDon't add cpio TRAILER!!! entry by default, add new --trailer option if you
Rob Landley [Sun, 4 Jun 2017 18:15:51 +0000 (13:15 -0500)]
Don't add cpio TRAILER!!! entry by default, add new --trailer option if you
want that. (This lets you concatenate cpio archives with "cat". Kernel's
initramfs extractor doesn't need it.)

6 years agoMerge remote-tracking branch 'toybox/master' into HEAD
Elliott Hughes [Fri, 2 Jun 2017 21:16:31 +0000 (14:16 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD

Change-Id: I4e1f8b76f8bd04e64aebf3f2f90afb7d07f9e357

6 years agoAllow ':' in property names.
Elliott Hughes [Wed, 31 May 2017 18:01:11 +0000 (11:01 -0700)]
Allow ':' in property names.

Bug: http://b/62114389
Test: setprop
Change-Id: I165bcc01bb2422d991f746c5e6490cbdfb74472f

6 years agoMerge "Allow ':' in property names."
Treehugger Robot [Wed, 31 May 2017 19:59:16 +0000 (19:59 +0000)]
Merge "Allow ':' in property names."

6 years agoAllow ':' in property names.
Elliott Hughes [Wed, 31 May 2017 18:01:11 +0000 (11:01 -0700)]
Allow ':' in property names.

Bug: http://b/62114389
Test: setprop
Change-Id: I165bcc01bb2422d991f746c5e6490cbdfb74472f

6 years agotoybox: Enable LSPCI functionality
Dmitry Shmidt [Tue, 30 May 2017 22:25:12 +0000 (15:25 -0700)]
toybox: Enable LSPCI functionality

Bug: 37852727
Test: Manual

Change-Id: I6c3767f7d888f07093593f715190f6131949421a
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
6 years agoteach head -v and -q
Ilya Kuzmich [Sun, 28 May 2017 14:03:26 +0000 (17:03 +0300)]
teach head -v and -q

Not POSIX, but implemented in coreutils and busybox.
Tests use sed to compensate for the stdin naming difference.

Signed-off-by: Ilya Kuzmich <ilya.kuzmich@gmail.com>
6 years agoReplace two space indents with tab indents in help text (for consistency).
Rob Landley [Sat, 27 May 2017 20:54:16 +0000 (15:54 -0500)]
Replace two space indents with tab indents in help text (for consistency).

6 years agoAdd separators in help -a with command name.
Rob Landley [Sat, 27 May 2017 19:57:45 +0000 (14:57 -0500)]
Add separators in help -a with command name.

6 years agoBe more consistent about periods in help text.
Elliott Hughes [Fri, 26 May 2017 00:56:11 +0000 (17:56 -0700)]
Be more consistent about periods in help text.

6 years agoMerge remote-tracking branch 'toybox/master' into HEAD
Elliott Hughes [Thu, 25 May 2017 21:16:21 +0000 (14:16 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD

Change-Id: I509bcbfc1215b09f0b4559397408a8e785395651

6 years agoAdd -0 to env.
Rob Landley [Thu, 25 May 2017 18:27:22 +0000 (13:27 -0500)]
Add -0 to env.

6 years agoTeach env that - as first argument means -i for some reason. (Posix!)
Rob Landley [Thu, 25 May 2017 18:00:00 +0000 (13:00 -0500)]
Teach env that - as first argument means -i for some reason. (Posix!)

6 years agoAdd and use xmmap.
Elliott Hughes [Wed, 24 May 2017 00:35:49 +0000 (17:35 -0700)]
Add and use xmmap.

Everyone forgets that mmap returns MAP_FAILED rather than NULL on failure.
Every use of mmap in toybox was either doing the wrong check, or no check
at all (including the two I personally added).

6 years agoAdd minof/maxof macros that autodetect type. Make xzcat use them.
Rob Landley [Tue, 23 May 2017 20:48:26 +0000 (15:48 -0500)]
Add minof/maxof macros that autodetect type. Make xzcat use them.

6 years agofixup code style
Joyounger [Tue, 23 May 2017 16:36:35 +0000 (00:36 +0800)]
fixup code style

Signed-off-by: Joyounger <aquanox@163.com>
6 years agoPromote chrt
Rob Landley [Sun, 21 May 2017 18:23:34 +0000 (13:23 -0500)]
Promote chrt

6 years agoCleaup chrt
Rob Landley [Sun, 21 May 2017 18:11:42 +0000 (13:11 -0500)]
Cleaup chrt

6 years agoAdd bzip2 support to tar.
Elliott Hughes [Sat, 13 May 2017 01:30:03 +0000 (18:30 -0700)]
Add bzip2 support to tar.

Also trivial cleanup of pipe -> xpipe.

Bug: http://b/38215123

6 years agoImplement date %N, loosely inspired by Elliott Hughes's patch.
Rob Landley [Fri, 19 May 2017 17:35:36 +0000 (12:35 -0500)]
Implement date %N, loosely inspired by Elliott Hughes's patch.

I didn't implement %37N's ability to insert zeroes, so removed those
two tests. If you really need it, I can add the divide loop back.

7 years agofactor shouldn't give incorrect answers for >64-bit integers.
Elliott Hughes [Sat, 13 May 2017 19:48:35 +0000 (12:48 -0700)]
factor shouldn't give incorrect answers for >64-bit integers.

7 years agoMinor tweaks to install.sh.
Rob Landley [Sun, 14 May 2017 20:10:29 +0000 (15:10 -0500)]
Minor tweaks to install.sh.

7 years agoMerge remote-tracking branch 'toybox/master' into HEAD
Elliott Hughes [Fri, 12 May 2017 00:21:45 +0000 (17:21 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD

Change-Id: I6f2e84dbc875ca0e85c0a87685fd2bd39d1df617

7 years agoSwitch to testcmd and add "-e all but \c" test.
Rob Landley [Thu, 11 May 2017 17:31:43 +0000 (12:31 -0500)]
Switch to testcmd and add "-e all but \c" test.

7 years agoMake fewer assumptions about the shell in echo.test.
Elliott Hughes [Wed, 10 May 2017 20:51:44 +0000 (13:51 -0700)]
Make fewer assumptions about the shell in echo.test.

This test fails with mksh, but we're not here to test mksh.

7 years agoMove strend() to lib/lib.c
Rob Landley [Tue, 9 May 2017 04:01:06 +0000 (23:01 -0500)]
Move strend() to lib/lib.c

7 years agoRemove old uClibc compatibility glue. It's been 5 years since the last release.
Rob Landley [Tue, 9 May 2017 03:09:08 +0000 (22:09 -0500)]
Remove old uClibc compatibility glue. It's been 5 years since the last release.
See http://lists.busybox.net/pipermail/buildroot/2016-December/180102.html
for a full post-mortem on the project.

7 years agoNow that xopen() no longer returns stdio, !fd doesn't need strcmp("-") to verify
Rob Landley [Mon, 8 May 2017 23:25:22 +0000 (18:25 -0500)]
Now that xopen() no longer returns stdio, !fd doesn't need strcmp("-") to verify

7 years agoFix error in writing output that was causing zcat to always fail.
Mike Moreton [Fri, 23 Sep 2016 07:46:11 +0000 (08:46 +0100)]
Fix error in writing output that was causing zcat to always fail.

7 years agoError if we can't autodetect filesystem type.
Rob Landley [Mon, 8 May 2017 03:48:44 +0000 (22:48 -0500)]
Error if we can't autodetect filesystem type.

7 years agoAdd all the toybox symbolic links to recovery.
Elliott Hughes [Sat, 6 May 2017 01:02:04 +0000 (18:02 -0700)]
Add all the toybox symbolic links to recovery.

We're currently shipping a full toybox binary in /sbin on the recovery image,
so it seems silly to only have the modprobe symbolic link when you could have
the full set.

Bug: N/A
Test: builds
Change-Id: I307a93dbba79d4f306eb0b20c4190b9571433c37

7 years agoInclude $(BUILD_NUMBER_FROM_FILE) in the toybox --version.
Elliott Hughes [Fri, 5 May 2017 20:28:50 +0000 (13:28 -0700)]
Include $(BUILD_NUMBER_FROM_FILE) in the toybox --version.

Also remove the SHA, which we haven't needed yet and isn't particularly
easy to turn back into source anyway.

Also switch to sed rather than awk, because macOS awk is lame:

  awk: syntax error at source line 1
   context is
          match($0, >>>  /TOYBOX_VERSION.*"(.*)"/, <<<
  awk: bailing out at source line 1

Bug: http://b/27534935 (for the macOS awk problem)
Test: toybox --version
Change-Id: If2d86b1ef098f1710843e32f7345ae5cf251fabb

7 years agoSwitch to toybox gzip/gunzip/zcat.
Elliott Hughes [Thu, 4 May 2017 05:53:47 +0000 (22:53 -0700)]
Switch to toybox gzip/gunzip/zcat.

Bug: http://b/36653902
Test: ran (not yet upstreamed) toybox tests
Change-Id: I9f79abe6861c8673e348a79b4a9c60b630d9a28f

7 years agoAdd toybox_vendor for treble products
Sandeep Patil [Wed, 12 Apr 2017 21:53:55 +0000 (14:53 -0700)]
Add toybox_vendor for treble products

Make the executable static so it doesn't have links back to /system and
build it only for treble products.

Bug: 36463595
Test: toybox_vendor and its symlinks are installed in /vendor and
      working on sailfish

(cherrypick of 19da0701da03ab44053780ea24d2586b66763222)

Change-Id: I1f5c8ba6b7f243a163cbefbfe76d1b098d31fcd8
Signed-off-by: Sandeep Patil <sspatil@google.com>
7 years agolibselinux can depend on libcutils
Mark Salyzyn [Mon, 1 May 2017 22:21:17 +0000 (15:21 -0700)]
libselinux can depend on libcutils

static library ordering to deal with libselinux depending on
libcutils.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Test: compile
Bug: 36645158
Bug: 37751120
Change-Id: Ida0d825847ccef423c55849e7fc52be5cdcc5f5b

7 years agoRemove mkfifo from the uncategorized list.
Elliott Hughes [Wed, 3 May 2017 21:50:24 +0000 (14:50 -0700)]
Remove mkfifo from the uncategorized list.

Bug: N/A
Test: builds
Change-Id: I98ff20888969b833c229a1c585f665865c085643

7 years agoFix the find tests.
Elliott Hughes [Wed, 3 May 2017 00:26:30 +0000 (17:26 -0700)]
Fix the find tests.

Four of the find tests were failing because they require mkfifo.

mkfifo also came up trying to run heaptrack on Android.

Bug: N/A
Test: ran find tests
Change-Id: I693818ddff42e516c370b2bfabd39b5486bd0d95

7 years agoMerge remote-tracking branch 'toybox/master' into HEAD
Elliott Hughes [Tue, 2 May 2017 18:34:07 +0000 (11:34 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD

Change-Id: I1b1ca7c3fb41586cdbad50f49d67f61ff12c9718

7 years agoAndroid NDK doesn't have cutils/sched_policy.h so add a probed config symbol.
Rob Landley [Sun, 30 Apr 2017 07:46:36 +0000 (02:46 -0500)]
Android NDK doesn't have cutils/sched_policy.h so add a probed config symbol.

7 years agoAndroid needs -llog to link.
Elliott Hughes [Fri, 28 Apr 2017 22:25:56 +0000 (15:25 -0700)]
Android needs -llog to link.

7 years agoBuilding mkpasswd on Android makes no sense.
Elliott Hughes [Fri, 28 Apr 2017 22:21:36 +0000 (15:21 -0700)]
Building mkpasswd on Android makes no sense.

And won't work anyway because we don't have crypt(3).

7 years agoImplement zlib-based gzip/gunzip/zcat.
Elliott Hughes [Wed, 26 Apr 2017 22:01:41 +0000 (15:01 -0700)]
Implement zlib-based gzip/gunzip/zcat.

7 years agoElliott wants to run the toybox tests on android host and there's an sh but
Rob Landley [Wed, 26 Apr 2017 21:36:19 +0000 (16:36 -0500)]
Elliott wants to run the toybox tests on android host and there's an sh but
it isn't toysh, so test for a bash alias.

7 years agoForgot to check in one of the files for bzcat.test
Rob Landley [Tue, 25 Apr 2017 07:21:39 +0000 (02:21 -0500)]
Forgot to check in one of the files for bzcat.test

7 years agoAnother FAQ, and some related tweaks as long as I was there.
Rob Landley [Tue, 25 Apr 2017 00:01:33 +0000 (19:01 -0500)]
Another FAQ, and some related tweaks as long as I was there.

7 years agoMerge remote-tracking branch 'toybox/master' into HEAD
Elliott Hughes [Mon, 24 Apr 2017 17:37:49 +0000 (10:37 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD

Change-Id: I1f472e17af7d5ead3a40bb174d554c6c92d33392

7 years agoAdd ls -ll (with --full-time as a compatibility synonym) to show nanoseconds.
Rob Landley [Wed, 19 Apr 2017 06:44:16 +0000 (01:44 -0500)]
Add ls -ll (with --full-time as a compatibility synonym) to show nanoseconds.
(And, for some reason, timezone. Individual files have timezones?)

7 years agoThe kernel needs bc to build because
Rob Landley [Tue, 18 Apr 2017 18:19:07 +0000 (13:19 -0500)]
The kernel needs bc to build because
https://landley.net/notes-2013.html#28-03-2013 so add it to the airlock install.

7 years agoMerge remote-tracking branch 'toybox/master' into HEAD
Elliott Hughes [Mon, 17 Apr 2017 18:40:08 +0000 (11:40 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD

7 years agoUse $(( rather than $[ for arithmetic in expand.test.
Elliott Hughes [Sat, 15 Apr 2017 18:27:18 +0000 (11:27 -0700)]
Use $(( rather than $[ for arithmetic in expand.test.

I can't find any reference to $[ for arithmetic on the bash man page, but it
seems to be a synonym for $((. mksh doesn't support this, so the expand tests
that use it fail on Android. No other toybox tests are using $[.

7 years agoMake ls.test work without awk.
Elliott Hughes [Fri, 14 Apr 2017 20:43:16 +0000 (13:43 -0700)]
Make ls.test work without awk.

7 years agoMerge remote-tracking branch 'toybox/master' into HEAD
Elliott Hughes [Mon, 17 Apr 2017 16:57:16 +0000 (09:57 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD

7 years agoSpeed up tail.test for shells without builtin printf.
Elliott Hughes [Sat, 8 Apr 2017 06:15:52 +0000 (23:15 -0700)]
Speed up tail.test for shells without builtin printf.

The test only needs echo, and Android currently doesn't use mksh's
builtin printf; the toybox printf is fuller featured and less buggy,
but a lot slower to call in a loop like this (and mksh doesn't fall
back to the printf on the path if given something it can't handle,
so we can't have the best of both worlds).

Without this hack, the tail test takes as long as all the other
tests put together.

7 years agoDefault to -b rather than -q when output is to a tty.
Rob Landley [Wed, 12 Apr 2017 18:41:10 +0000 (13:41 -0500)]
Default to -b rather than -q when output is to a tty.

7 years agoFix "make test_split".
Elliott Hughes [Sat, 8 Apr 2017 06:00:54 +0000 (23:00 -0700)]
Fix "make test_split".

The test shouldn't assume there's a toybox binary on the path.

7 years agoMerge remote-tracking branch 'toybox/master' into HEAD
Elliott Hughes [Tue, 11 Apr 2017 19:36:15 +0000 (12:36 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD

7 years agoSilence a broken warning by hitting it with a rock.
Rob Landley [Tue, 11 Apr 2017 18:38:37 +0000 (13:38 -0500)]
Silence a broken warning by hitting it with a rock.

7 years agoMake fdisk buildable.
Elliott Hughes [Wed, 5 Apr 2017 17:13:47 +0000 (10:13 -0700)]
Make fdisk buildable.

The argument to help_exit is a char*, not a FILE*.

7 years agoFix touch -a/-m (and add the missing tests).
Elliott Hughes [Thu, 6 Apr 2017 21:44:45 +0000 (14:44 -0700)]
Fix touch -a/-m (and add the missing tests).

utimensat takes atime in [0] and mtime in [1], but since we're overwriting
with UTIME_OMIT, we actually want to flip the comparison so -a blats 1 and
-m blats 0.

7 years agoAdd "uudecode -o -" support.
Elliott Hughes [Mon, 3 Apr 2017 21:12:08 +0000 (14:12 -0700)]
Add "uudecode -o -" support.

busybox uudecode supports this, and POSIX explicitly mentions it (albeit
only in the "STDOUT" section). Plus Android doesn't have /dev/stdout and
/dev/stdin, so this lets us rewrite the uudecode tests so they pass on
Android too.

7 years agoFix the ls -m test (which is just a whitespace issue, but eh).
Rob Landley [Sat, 8 Apr 2017 18:52:18 +0000 (13:52 -0500)]
Fix the ls -m test (which is just a whitespace issue, but eh).

While we're at it, ls -m wordwrap was one column early.

7 years agoMerge remote-tracking branch 'toybox/master' into HEAD
Elliott Hughes [Fri, 7 Apr 2017 23:21:07 +0000 (16:21 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD

7 years agoMake renice.test work without awk.
Elliott Hughes [Mon, 3 Apr 2017 15:57:42 +0000 (08:57 -0700)]
Make renice.test work without awk.

Also try to only kill processes we created.

7 years agoRemove mount.test awk dependency.
Elliott Hughes [Mon, 3 Apr 2017 15:33:23 +0000 (08:33 -0700)]
Remove mount.test awk dependency.

Parsing file(1) output isn't a good way to determine file system type anyway.

7 years agoMake pgrep tests runnable on toybox-only systems.
Elliott Hughes [Sun, 2 Apr 2017 19:29:39 +0000 (12:29 -0700)]
Make pgrep tests runnable on toybox-only systems.

Also make the cleanup kill more focused.

7 years agoMake pkill tests runnable on a toybox-only system.
Elliott Hughes [Sun, 2 Apr 2017 19:20:53 +0000 (12:20 -0700)]
Make pkill tests runnable on a toybox-only system.

Also use a much stricter regex in the regex test to avoid killing innocent
bystanders.

7 years agoMake bzcat tests runnable on a toybox-only system.
Elliott Hughes [Sun, 2 Apr 2017 19:27:38 +0000 (12:27 -0700)]
Make bzcat tests runnable on a toybox-only system.

7 years agoAdd "testcmd" function as an alternative to "testing" for tests/*.test, and
Rob Landley [Tue, 4 Apr 2017 23:13:51 +0000 (18:13 -0500)]
Add "testcmd" function as an alternative to "testing" for tests/*.test, and
check in two converted commands.

7 years agoMerge changes I85f365f5,I2b3c82fb,I4f196054,I9343237c,I53e4444f, ...
Treehugger Robot [Tue, 4 Apr 2017 19:47:22 +0000 (19:47 +0000)]
Merge changes I85f365f5,I2b3c82fb,I4f196054,I9343237c,I53e4444f, ...

* changes:
  Merge remote-tracking branch 'toybox/master' into HEAD
  Implement dmesg -T.
  Don't try to implement %s, we have @seconds, strptime() in libc tends not to have it, and implementing our own means a pattern like "Time %%%s%%" is expensive to handle the corner cases of.
  New date range tests are simple, won't catch Feb 29 in non-leap-year (or April 31 in any year). Some normalization allowed, exclusions are just what http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html says.
  Replace chkmktime() (which produces false positive normalization failures) with range checks for seconds, minutes, hours, day of month, and month.
  ps: don't query for terminal size if not a tty.
  Fix the type of the callback in getprop.
  We grew a few more commands that weren't on the roadmap (mostly from android) so throw them in the "requests" category so they show up in status.html.

7 years agoMerge remote-tracking branch 'toybox/master' into HEAD
Elliott Hughes [Tue, 4 Apr 2017 17:47:54 +0000 (10:47 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD

Change-Id: I85f365f5bc991ebefb12500ee1f53b3d250f814a

7 years agoFix ls -a and ls -A tests.
Elliott Hughes [Sun, 2 Apr 2017 18:58:49 +0000 (11:58 -0700)]
Fix ls -a and ls -A tests.

7 years agoTrivial cleanup. (Whitespace, brackets, and remove unnecessary typecasts.)
Rob Landley [Mon, 3 Apr 2017 21:57:40 +0000 (16:57 -0500)]
Trivial cleanup. (Whitespace, brackets, and remove unnecessary typecasts.)

7 years agoAdd gzip support. (Doesn't show source OS and timestamp, but reporting them
Rob Landley [Mon, 3 Apr 2017 20:48:21 +0000 (15:48 -0500)]
Add gzip support. (Doesn't show source OS and timestamp, but reporting them
isn't obviously useful.)

7 years agoImplement dmesg -T.
Elliott Hughes [Sat, 25 Mar 2017 20:08:20 +0000 (13:08 -0700)]
Implement dmesg -T.

Also refactor so that legacy mode gets all the new functionality too, and
add -S to make it easier to test legacy mode on 3.5 or newer kernels (at least
on the host; on Android the syslog(2) system call is no longer allowed).

Bug: http://b/36090178

7 years agoBuild toybox diff.
Elliott Hughes [Mon, 3 Apr 2017 14:56:14 +0000 (14:56 +0000)]
Build toybox diff.
am: 98aae74f4a

Change-Id: Ib6b754428ce1f0836729fedaeab077aa539acb5d

7 years agoBuild toybox diff.
Elliott Hughes [Sat, 1 Apr 2017 16:18:14 +0000 (09:18 -0700)]
Build toybox diff.

Necessary to run toybox tests on the device (and presumably any other
command-line testing that wants to compare actual to expected results).

Bug: N/A
Test: ran toybox tests on-device (script coming soon)
Change-Id: Ib7a6044d6d6af4fc34996e66cba0a023b3e8dce4

7 years agoDon't try to implement %s, we have @seconds, strptime() in libc tends
Rob Landley [Wed, 29 Mar 2017 01:39:31 +0000 (20:39 -0500)]
Don't try to implement %s, we have @seconds, strptime() in libc tends
not to have it, and implementing our own means a pattern like
"Time %%%s%%" is expensive to handle the corner cases of.

7 years agoNew date range tests are simple, won't catch Feb 29 in non-leap-year
Rob Landley [Wed, 29 Mar 2017 01:19:28 +0000 (20:19 -0500)]
New date range tests are simple, won't catch Feb 29 in non-leap-year
(or April 31 in any year). Some normalization allowed, exclusions are just
what http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html says.

7 years agoReplace chkmktime() (which produces false positive normalization failures)
Rob Landley [Wed, 29 Mar 2017 01:16:41 +0000 (20:16 -0500)]
Replace chkmktime() (which produces false positive normalization failures)
with range checks for seconds, minutes, hours, day of month, and month.

7 years agoUse external/bzip2 for bunzip2 and bzcat.
Elliott Hughes [Wed, 29 Mar 2017 00:36:33 +0000 (00:36 +0000)]
Use external/bzip2 for bunzip2 and bzcat.
am: 7602ee6309

Change-Id: I04637694adfadc341d8239cc63742c8fd4880f91

7 years agops: don't query for terminal size if not a tty.
Josh Gao [Mon, 27 Mar 2017 22:53:03 +0000 (15:53 -0700)]
ps: don't query for terminal size if not a tty.

`ps -A | cat` shouldn't have different output depending on the size of
your terminal window.

7 years agoUse external/bzip2 for bunzip2 and bzcat.
Elliott Hughes [Tue, 28 Mar 2017 06:02:40 +0000 (23:02 -0700)]
Use external/bzip2 for bunzip2 and bzcat.

external/bzip2 also gives us bzip2.

Bug: http://b/36653808
Test: builds
Change-Id: Ib73563face4e0d2677e06652cd3fb7b36c7e6e17

7 years agoFix the type of the callback in getprop.
Elliott Hughes [Wed, 22 Mar 2017 17:35:14 +0000 (10:35 -0700)]
Fix the type of the callback in getprop.

Fixes:

  toys/android/getprop.c:56:39: warning: incompatible pointer types
    passing 'void (void *, const char *, const char *)' to parameter of
    type 'void (*)(void *, const char *, const char *, uint32_t)'
    (aka 'void (*)(void *, const char *, const char *, unsigned int)')
    [-Wincompatible-pointer-types]

  __system_property_read_callback(pi, read_callback, NULL);
                                      ^~~~~~~~~~~~~

7 years agoWe grew a few more commands that weren't on the roadmap (mostly from android)
Rob Landley [Fri, 24 Mar 2017 16:59:26 +0000 (11:59 -0500)]
We grew a few more commands that weren't on the roadmap (mostly from android)
so throw them in the "requests" category so they show up in status.html.

7 years agoMerge remote-tracking branch 'toybox/master' into HEAD
Elliott Hughes [Fri, 24 Mar 2017 16:57:43 +0000 (16:57 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD
am: f6e803dd5c

Change-Id: I77b0ed43d8309eadd39cf63ea4b4e5e23cb37fe0

7 years agoMerge remote-tracking branch 'toybox/master' into HEAD
Elliott Hughes [Fri, 24 Mar 2017 06:19:37 +0000 (23:19 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD

7 years agoNow that just about everything has --help, don't output help for argument errors
Rob Landley [Thu, 23 Mar 2017 16:35:09 +0000 (11:35 -0500)]
Now that just about everything has --help, don't output help for argument errors

7 years agoMerge "removed toybox_static (and modprobe) from normal mode"
Jaesoo Lee [Thu, 23 Mar 2017 00:23:12 +0000 (00:23 +0000)]
Merge "removed toybox_static (and modprobe) from normal mode"
am: 78605fcb21

Change-Id: Idbf35653565bbbcbaa6b3679ceae5f63171a32ff