aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
AgeCommit message (Collapse)Author
2020-08-04xparsedate: support UTC offsets.Elliott Hughes
Requested in https://github.com/landley/toybox/issues/130, quoting an old version of the toybox help. This is also supported by coreutils. Set $LANG to C in the date tests so that they pass with TEST_HOST=1 (they were already failing for me, presumably related to a newer glibc).
2020-08-04xargs: fix help formatting.Elliott Hughes
2020-08-03Mark Salyzyn implemented support for xargs -P (run parallel jobs) because heRob Landley
has a build script that goes much faster with it, and added tests for it. I reimplemented it a different way, and did SIGUSR1 and SIGUSR2 support.
2020-07-30Don't need "match", just test *t.Rob Landley
2020-07-30find: support -type a,b,c.Elliott Hughes
Fixes #227.
2020-07-20patch fuzz: Always output original file's ' ' context lines, not from hunk.Rob Landley
2020-06-23William Djupström reported tar --exclude wasn't working. Fix and add test.Rob Landley
(Also fix -v output going to stderr when it shouldn't.)
2020-06-16file: add GIF version information.Elliott Hughes
This let me compare against the host for #225.
2020-06-16Ryan Prichard reported that file wasn't getting gif heights right.Rob Landley
2020-06-09chmod: fix -R and dangling symlinks.Elliott Hughes
Found trying to run the libc++ tests. For coreutils, `info chmod` says: 'chmod' ignores symbolic links encountered during recursive directory traversals. Bug: http://b/155809792
2020-06-09tar: fix bugs with adding hardlinks to archiveWilliam Djupström via Toybox
2020-06-08tar: fix extracting long file pathsWilliam Djupström
2020-05-31sed: add -s to the synopsis too.Elliott Hughes
2020-05-30Ethan Sommer pointed out an unnecessary return.Rob Landley
2020-05-29Add sed -sRob Landley
2020-05-28remove unneeded ; after GLOBALSEthan Sommer
2020-05-09Shrink sed --help from 150 lines to 91.Rob Landley
2020-05-01Minor cleanup.Rob Landley
2020-04-28Remove unnecessary MAYFORK.Rob Landley
2020-04-20patch: fix out of bounds memory access.Elliott Hughes
On empty lines, we'd read one byte before the start of the buffer.
2020-04-16cpio: fix tests by removing --trailer.Elliott Hughes
f2866cf58a07c9d681ecd6695ea969ac70e59a3d fixed the cpio --trailer check as it claimed to, but doing so changed our behavior (since it used to be always-on and is now off unless you supply --trailer). This broke one of the cpio tests. Since I can't find any other cpio that has a --trailer option (or its inverse), this patch removes --trailer. This reverts our behavior to our old behavior (always include the trailer). Judging by the fact that the cpio tests pass with TEST_HOST=1, this seems to be the expected behavior.
2020-04-15cpio: fix --trailer flag check, switch to FLAG() macros.Ethan Sommer
2020-04-13Humor asan.Rob Landley
(ls would read from an uninitalized variable and never use the result because the test is afterwards, but asan freaks about impurity and unclean quantum state that's never observed or some such. You read uninitialized but definitely allocated stack memory into a REGISTER, and then performed an ADDITION on it to produce a result you never use! For SHAME!)
2020-04-13Add unescape2(), migrate some unescape() users over.Rob Landley
2020-04-08ls: fix -h with block counts.Elliott Hughes
The filter() function modifies st_blocks so it's always 1KiB rather than 512B blocks, but the human-readable output was still assuming 512B. This meant that `ls -sh` was showing figures half the size of `ls -s`, and that the "total" line with -h was also off by a factor of 2. No new test, because I don't know how to write one that would work on all file systems. Bug: http://b/153383721
2020-04-07Use optc to detect end of arguments, because [ removes ] but doesn't zero it.Rob Landley
2020-03-29file: add 7z formatJoeky
2020-03-28sed s///: support POSIX I as synonym for iElliott Hughes
POSIX chose I rather than i as the case-insensitive flag for s///, because apparently more seds support I than i. We're allegedly alone in only supporting i. (On the Mac, sed supports neither.) Strictly this isn't *currently* in POSIX, but it's been accepted for issue 8. Bug: https://austingroupbugs.net/view.php?id=779#c2050
2020-03-26du: consistent --help capitalization.Elliott Hughes
2020-03-26du: Implement -bRob Landley
2020-03-23tar: implement --absolute-names.Elliott Hughes
Used by the Linux kernel build when copying kernel headers to kernel-headers.tar.gz. Bug: http://b/152244851
2020-03-18Fix WARN_ONLY (and the one caller feeding it in the field it was checking).Rob Landley
2020-03-13Fix various typos.Elliott Hughes
In case I'm not yet in the running for the most pedantic change of this release, I think the "days of the week are written with initial capitals in English" subset of this patch is a strong contender. (Found via `toybox help -a | ispell -l | sort | uniq`.)
2020-03-08cp: fix -D (--parents) (REWORK MINIMAL FIX)Jarno Mäkipää
add: test for -D fix: b/c/d/FILE not copying into a/ with -D option dirname() is not needed when handling FLAG(D) since filename under src or dest should not be changed. github.com/landley/toybox/issues/165
2020-03-03Remove another command sub-option.Rob Landley
The question "how does this toybox command behave" should have an answer, not "it depends". (Also, --preserve at the start of a paragraph was confusing config2help.c into thinking it was an option paragraph.)
2020-03-02Merge realpath into readlink, use xabspath() instead of libc realpath().Rob Landley
2020-02-28Some compilers get upset if ? : produces different types.Rob Landley
2020-02-25ps: widen pid_t fields.Elliott Hughes
My desktop and laptop have a pid_max of 262144 now.
2020-02-24Fix fuzz to output lines that didn't match patch context.Rob Landley
(It was outputting the patch hunk where it went, which reverted the context.)
2020-02-06Remove old GNU style `' quoting.Elliott Hughes
Even GNU don't pretend they're still on 1970s terminals where ` and ' were a matching pair any more.
2020-02-02Canonicalize the usage: lines for the POSIX toys.Elliott Hughes
This only touches 24 of the 68 toys/posix/ files --- the others were already canonical. Potentially contentious, so worth stating explicitly, is that there were 8 matches for "COMMAND..." amongst all existing help output, with 7 matches for various inconsistent variants involving something with "ARG", so I resolved that in favor of using "COMMAND..." (which is also shorter overall, and avoids nested []s).
2020-01-28David Legault complained that dir/.* tells rm to delete dir/.. and we'd do it.Rob Landley
2020-01-26Add mayfork to printfRob Landley
2020-01-24cp/mv: add -T.Elliott Hughes
The kernel script scripts/kconfig/merge_config.sh uses cp -T. (Also sort the options into alphabetical order while adding -T, so that eyeball binary search actually works when trying to find an option! Oddly, they all show in reverse order because there's a bug in the help text generator, but that's a problem for another day...)
2020-01-20cal: highlight current day.Elliott Hughes
This isn't in POSIX, but Debian and macOS' cal(1)s both do this, and it's annoying to have to run date(1) separately.
2020-01-11find.c: don't assume time_t is the same as longRich Felker
This is false on ILP32 targets with 64-bit time_t.
2020-01-09ls.c: just use getxattr()/lgetxattr().Elliott Hughes
bionic works around the fact that you can't use an O_PATH fd with fgetxattr(2), but glibc doesn't. Fixes https://github.com/landley/toybox/issues/158.
2020-01-08Implement readelf(1).Elliott Hughes
Basic readelf(1) implementation, with output close enough to the binutils version to be usable with scripts that expect the binutils version. This started as an implementation of nm(1) until I realized that I almost always want readelf instead, and that you actually have to do much of the work needed for readelf just to implement nm. Arguably nm (being part of POSIX) belongs in toybox while readelf doesn't. An argument could also be made that neither really belongs in toybox, belonging in a separate set of development tools (such as binutils or the LLVM binutils). Doesn't support most of the architecture-specific stuff, most notably relocations, but is aware of things like ARM exidx sections and the common register state notes in core dumps for the "big four" architectures: arm, arm64, x86, and x86-64. Doesn't support symbol versions (but probably should). Doesn't support section groups or the -t "section details" (which is a long form of -S "section headers" that I've never seen used in practice and which isn't part of -a). Doesn't support dumping unwind info or the hash table bucket histograms. Reuses the table of ELF architectures from file(1). Not fuzzed, but successfully parses all the ELF files in my Ubuntu 18.04 system's lib directories. Attempts to exit with an error when presented with an invalid ELF file rather than struggle on as binutils seems to.
2020-01-06date.c: add a few more important specifiers to --help.Elliott Hughes
Odd (and un-toyboxy) that we advertise the locale-specific output formats but not the ISO ones :-)
2020-01-01Add MAYFORK to more pseudo-builtins.Rob Landley
This doesn't (yet) add shell builtin awareness to time, kill, or pwd, just lets them run in the shell process.