aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-06-25Make chgrp and chown tests work on Android.Elliott Hughes
There's no /etc/passwd and /etc/group, but there are enough users and groups that we can test with. ("bin" and "daemon" were added for LTP; "shell" is what you get with `adb shell`.)
2019-06-25blkid: adapt tests for util-linux blkid.Elliott Hughes
util-linux's blkid doesn't support reading from stdin, so move that to being a special toyonly test rather than the default. toybox blkid differs from util-linux in that it doesn't seem to find the LABEL for the checked-in example f2fs file system (the offset is wrong, but also f2fs uses LE16 strings), nor does it support the SEC_TYPE that util-linux blkid shows for several of the test file systems.
2019-06-25Start over on toysh.Rob Landley
Basic line continuation logic (to prompt with $PS2). Doesn't use result yet.
2019-06-25losetup: minor fixes.Elliott Hughes
Fix `losetup -f` to not fail with an error. Add the missing \n for `losetup -f --show FILE`. Use decimal for the device number, like the desktop losetup. Switch to the FLAG macro. Make the tests runnable as tests, and expand coverage a bit. With this patch, the tests pass both with and without TEST_HOST on the desktop. Note though that this patch is part of fixing some real-life losetup issues, not part of the "test cleanup" I'm also looking at. losetup is low down that list!
2019-06-25lib/args.c: add quotes.Elliott Hughes
This failure was a little hard to parse: tar: Unknown option mode (see "tar --help") This would have been clearer: tar: Unknown option 'mode' (see "tar --help")
2019-06-25tar: implement --mode.Elliott Hughes
Used by build/make/tools/mktarball.sh in AOSP. (Which is why today's switch to toybox tar got reverted.)
2019-06-24diff: fix diff of stdin for systems without /tmp.Elliott Hughes
xtempfile() alreay does the right thing, so switch to that. Also use xsendfile() for the actual copying. Fixes the cat tests on Android.
2019-06-24Fix FAILCOUNT arithmetic for mksh.Elliott Hughes
mksh doesn't support $[], only $(()).
2019-06-23Switch cp.c to FLAG() macros.Rob Landley
2019-06-22Don't test shell builtin for kill.Rob Landley
2019-06-22Make testcmd work if the path to $PWD has a space in it.Rob Landley
2019-06-22Use FORCE_FLAGS in kill.c.Elliott Hughes
Otherwise kill flags don't work unless killall5 is also configured. Also switch to the FLAG() macro.
2019-06-22Fix mv with trailing slash in source.Denys Nykula
Press tab, have bash complete dir name with a slash, notice musl rename() dislikes that. Replace trailing slash in the cp loop with a null character, if the command name is mv. Add the slash back if an error occurs.
2019-06-21bc: fix a few bugs found in upstreamGavin Howard
2019-06-21bc: remove a power test that is now an errorGavin Howard
2019-06-21Fix cp -r dir/. symlink child.makepost
Remove the existing link before trying to re-create, passing the test. Add -p to the -r test as a regression guard, portage calls cp with both.
2019-06-20The O_PATH breaks stuff, have to work around Android's selinux rules for /Rob Landley
some other way.
2019-06-20Teach dlist_pop() to work on a dlist_terminate()d listRob Landley
2019-06-19Avoid a double-definition (iphdr) from netinet/in.h and linux/ip_tunnel.h by ↵Mike Bennett
locally defining the single constant definition ip.c uses (IP_DF) if not already defined.
2019-06-12bc: fix previous patchGavin Howard
I put the check into the wrong if. That was my bad. Again.
2019-06-11Add DIRTREE_STATLESS to return entries we couldn't stat().Rob Landley
Sets ->again |= 2 when that happens and ->st is zeroed. While we're there, don't memset(st) and then memcpy(st) over it, and use O_PATH in the open().
2019-06-11Move sig_to_num and num_to_sig into portability.c.Elliott Hughes
macOS doesn't have real-time signals, and it has a slightly different set of non-portable signals from Linux. With this, the toybox `kill -l` output matches the default macOS kill(1).
2019-06-11bc: fix a bug in powerGavin Howard
This bug is that an error should be returned when the user tries to take 0 to a negative power, since that is undefined, but bc would return 0.
2019-06-11find: add -true/-false.Elliott Hughes
Used near the end of the AOSP build. Almost there! (This patch also fiddles with the help text to be able to slip the new options in without requiring so much extra space.)
2019-06-10kill: add trivial -l tests.Elliott Hughes
(`kill -l HUP` and `kill -l 1` both said "HUP" instead of giving you back the one you didn't provide, before my real-time signal patch.)
2019-06-10Add failing test for cp -r dir/. symlink child.makepost
Gentoo packages that build multiple variants, like once for every version of a slotted dependency, currently fail to install if their source dir includes a relative symlink to own child. Affects lots of Python infrastructure, for example meson and setuptools. You've already run into this issue, since cp.test has a todo. It's from 2008 though, so I guess I'll bump with an expanded test case. Libc is musl-1.1.22.
2019-06-10Improve signal name<->number conversions.Elliott Hughes
Include all the signals, not just the POSIX ones. In particular, improve support for real-time signals. My attempt to switch AOSP builds over to toybox timeout got reverted when I broke the ART build bots which use SIGRTMIN+2. Also fix `kill -l 3` to show "QUIT" and `kill -l QUIT` to show "3". Also make the `kill -l` output include numbers and names, and format it to look better on a 80x24 tty, because it's always August 1978 somewhere.
2019-06-09Inverted test.Rob Landley
2019-06-08macOS: numerous fixes.Elliott Hughes
This patch adds a BSD version of xgetmountlist (for the path == NULL case only), tested on macOS. It also papers over the differences between macOS' and Linux's xattr APIs. For once I think the macOS one is better. The imitation of mknodat I've had to write swings things back in Linux's favor though. BSD calls f_frsize by the name f_iosize instead. (FWIW, it looks like this is meaningless on Linux and actually meaningful on macOS.) I've added one #if to toys/ --- I'm calling pathconf in stat.c to work around the absence of f_namelen, and have left a TODO with an explanation. I'm not sure what the best fix is here, so punting. No-one can agree what f_fsid is, even if they're all basically the same, so work around the `val` versus `__val` issue between macOS and Linux. With this patch, it's now possible to build cp/mv/install and stat for macOS too. (Which completes the set of "toybox commands currently used on Linux as part of the AOSP build" if you ignore stuff that deals with processes, which I doubt we'll ever be able to support for lack of any API.)
2019-06-07Remove getprop, setprop, start, and stop from toyboxTom Cherry
These are Android specific, so not really helping the outside community, and are getting more and more Android dependencies to work correctly, so let's drop these from toybox and build them within Android. Change-Id: Ic6022f1f506e10868c61f55d64fa4e7c1b14eba2
2019-06-07Implement stat %C and find %Z.Elliott Hughes
We'd documented find %Z but not implemented it. We'd neither documented nor implemented stat's corresponding %C (they'd already taken %Z for ctime, which is ironic because %c/%C sounds more obvious than %z/%Z for that to me).
2019-06-05macOS build parallelism.Elliott Hughes
Macs are slow enough without crippling them further!
2019-06-03Clean up remaining TAIL_SEEK references.Elliott Hughes
2019-06-03Remove TAIL_SEEK config option, just always include it.Rob Landley
Yeah, it's twice the size and two codepaths, but seekable is the common case, it won't work in pipelines without a non-seek codepath, and the performance penalty not using seek on large files is a enormous.
2019-06-03tail: fix macOS build.Elliott Hughes
Trivial breakage from the recent refactoring. Also add tail to the default config for macOS. I'm still unconvinced that CONFIG_TAIL_SEEK makes sense in a world where inotify support is always built in, but that's an argument for another day...
2019-06-03news.html: fix HTML, and be accurate about where `tail -f` was tested.Elliott Hughes
2019-06-01Teach file to recognize xz archives and old style tarballs.Rob Landley
2019-06-01Teach tar to extract older tarballs.Rob Landley
2019-05-29Release 0.8.1.0.8.1Rob Landley
2019-05-29Teach find -printf about %.Ns patterns, tweak help text, add tests.Rob Landley
2019-05-28Workaround for mkshRob Landley
(which doesn't handle "VAR=blah thingy" right if thingy is a function, the variable winds up staying set after the function returns.)
2019-05-26Teach sed about +N range ending.Rob Landley
2019-05-25find: add -printf support.Elliott Hughes
This only implements the format specifiers that I've seen used in the wild (which is actually a significant fraction of the total supported by findutils' find). The most obvious gap is in the time support. I'm happy to add more, but didn't want to add stuff "just because". I'd say %A@, %C@, and -- for SELinux users -- %Z are probably the most plausibly useful formats still missing. I don't think the human-readable date formatting is particularly useful unless someone's seen it actually used in the wild. The %T+ "full ISO" format being the most likely exception to that. Anyway, this is enough for me get started building AOSP with toybox find.
2019-05-25grep: add --exclude-dir.Elliott Hughes
Used quite a lot, especially with `--exclude-dir=.git`.
2019-05-25time: fix -v output.Elliott Hughes
Copy-and-paste mistake from the regular output. Bug: http://b/133502489
2019-05-25Move notify.c into portability.c (collate the #ifdefs), move global variablesRob Landley
into a structure passed as arguments, add x prefix to functions that can fail, add overflow test.
2019-05-25tail: support -f on BSD too.Elliott Hughes
Factor out the inotify code and add a kqueue equivalent. Specifically tested on macOS 10.14, but I assume this works for other BSDs too, given that I worked from the FreeBSD man page...
2019-05-25Toybox doesn't provide bzip2 or xz compression side (and the roadmap has it asRob Landley
out of scope), but the AOSP build airlock doesn't provide bzcat and friends. So tar needs to be able to use both: check for *zcat first, and fall back to "compressor -d" if it's not there.
2019-05-23tar: turns out --sparse is also known as -S.Elliott Hughes
Found trying to build the aosp_cf_x86_phone-userdebug target. The good news is that the targets that I knew were using tar with sparse files all pass now.
2019-05-23macos_miniconfig: remove pending tr and add non-pending toys.Elliott Hughes
Aside: I was surprised that `make defconfig` installs the default *Linux* config even on macOS.