Age | Commit message (Collapse) | Author |
|
Change names_to_pid() so that we can actually match shell scripts with
long names (the code to get the shell script's name was correct, but
there was an extra test preventing us from actually comparing it to the
sought name).
In kill.c itself, remove a dead test for -l and switch to the FLAG()
macro.
Also extend the tests to explicitly cover long and short names.
|
|
These tests don't work for me as root on either my Debian desktop or my
Android devices. The original mail thread implies that they were as
close as the original comitter could get to _something_ that seemed to
work, even if the kernel doesn't seem to bother with this:
http://lists.landley.net/pipermail/toybox-landley.net/2014-November/003795.html
toybox ifconfig *is* missing support for `-pointtopoint` and
`pointopoint` (without an addess), similar for `broadcast` according to
the man page. But since we don't appear to have a way to test this (other
than looking at strace output!) I'm leaning towards YAGNI anyway...
|
|
|
|
My app runs npm i -S better-sqlite3, and node-gyp-bin from the npm
upstream has #!/usr/bin/env sh, expecting the system shell.
|
|
Implement nl -v supporting negative and zero starting values.
|
|
Other implementations of netcat support UNIX domain sockets via -U, so
this change adds it to toybox too.
Example usage:
Create ./uds as a UNIX domain socket and listen on it, forwarding
messages to bash:
> nc -U -s ./uds -L /bin/bash
Connect to ./uds as a UNIX domain socket
> nc -U ./uds
|
|
|
|
I know that you are working on toysh which I'm looking forward to. In the
meantime below is a patch to improve compatibility with older/odd versions
of bash. This fixed a minor build issue I was having on MacOS (which was
using zsh in emulated bash mode) as well as an oddball embedded SDK using
a non-gnu version of bash. I believe these changes are minimal and should
be safe to apply, if not I wanted to at least get them on the mailing list
in case others ran into these issues.
|
|
Improve Android support (see code comments).
Remove unnecessary fixed-length limits.
Show error if module not found (plus test).
Expand help text.
Switch to FLAG macro.
Stop hard-coding module assumptions in the tests.
|
|
mksh doesn't support process substitution, so use an explicit temporary
file.
|
|
file now shows the target of a symbolic link and calls out broken
symbolic links.
file now shows the device type for block/character special files.
file now shows specific reason when it can't open.
stat now includes the device type, plus a little more space between the
number of blocks and the human-readable file type.
Adjusted tests accordingly, which actually makes more of them pass on
the host as a convenient side-effect, but I actually made these changes
because I've been finding the desktop file and stat output more convenient
in these cases.
|
|
I don't know why we fixed the other tests but not this one. Before this
patch it's failing with/without TEST_HOST. After this patch, it passes
both.
|
|
one in $PATH.
|
|
Use /dev/block/loop* more uniformly, and teach the tests which to expect.
|
|
|
|
The killall test still fails with toybox. Seems like right now killall
and pidof share name to pid logic, but playing about with the desktop
killall (which does pass this test), it seems like killall actually
behaves more like pgrep than pidof (which does seem to be this limited
on the desktop too)...
|
|
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`.)
|
|
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.
|
|
Basic line continuation logic (to prompt with $PS2). Doesn't use result yet.
|
|
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!
|
|
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")
|
|
Used by build/make/tools/mktarball.sh in AOSP. (Which is why today's
switch to toybox tar got reverted.)
|
|
xtempfile() alreay does the right thing, so switch to that.
Also use xsendfile() for the actual copying.
Fixes the cat tests on Android.
|
|
mksh doesn't support $[], only $(()).
|
|
|
|
|
|
|
|
Otherwise kill flags don't work unless killall5 is also configured.
Also switch to the FLAG() macro.
|
|
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.
|
|
|
|
|
|
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.
|
|
some other way.
|
|
|
|
locally defining the single constant definition ip.c uses (IP_DF) if not already defined.
|
|
I put the check into the wrong if. That was my bad. Again.
|
|
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().
|
|
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).
|
|
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.
|
|
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.)
|
|
(`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.)
|
|
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.
|
|
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.
|
|
|
|
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.)
|
|
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
|
|
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).
|
|
Macs are slow enough without crippling them further!
|
|
|
|
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.
|