Age | Commit message (Collapse) | Author |
|
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.)
|
|
|
|
|
|
More consistent tense, capitalization, and punctuation. A few commands were
missing an introductory line, so I copied those from the first comment
line.
|
|
|
|
|
|
Be consistent about upper versus lower case. (Upper seems to have the
majority, so I went with that, though I'm happy to provide the opposite
patch as long as we're consistent!)
Be consistent about using \t. (Though saving a few bytes seems like it
might be better done in the code that generates help.h rather than
directly in the source, since tabs make careful ASCII art layout hard
enough that we regularly have things misaligned.)
Remove trailing periods (most of which seem to have been added by me).
Always use the US "human readable" rather than my British
"human-readable", and be more consistent about declaring whether we're
showing multiples of 1000 or 1024.
Just say "verbose" rather than adding a useless "mode" or "output".
|
|
|
|
|
|
|
|
|
|
|
|
instead of a struct. This means it can return "12345" even if that user/group
doesn't exist in /etc/passwd and similar.
All the users were immediately dereferencing it to get pw_uid or gr_gid
anyway, so just return it directly and adjust the users. This fixes
things like "chown 12345:23456 filename".
|
|
|
|
"toybuf" should be initialized before calling symlinkat() or
dangling link could occur.
|
|
|
|
|
|
|
|
This fixes a failing test case in mv.test.
Test changes:
- Add coverage for -i (interactive).
- Better descriptions, better formatting, and removed some redundant
cases.
|
|
|
|
header unconditionally. (This fixes the warning when CP_PRESERVE disabled.)
|
|
handle infinite depth. Fix docs, tweak dirtree_handle_callback() semantics,
remove dirtree_start() and don't export dirtree_handle_callback(), instead
offer dirtree_flagread(). (dirtree_read() is a wrapper around dirtree_flagread
passing 0 for flags.)
|
|
Commit 3d33dd80f8cb931e293d7f64c44bc357fec11120 fixed a use of S_ISDIR
on st_dev rather than st_mode in find, but there was another instance
of the same error in cp.
|
|
checking, and fix up format checking complaints.
Added out(type, value) function to stat to avoid a zillion printf typecasts.
|
|
|
|
|
|
the global so "install -g 0" doesn't alias to "cp --preserve 0" and error out.
through to --preserve 0"
|
|
This fixes the build break, the change to yesno() prototype accidentally got
checked in last commit. (Oops, sorry.)
|
|
We need to remove the destination, not the source, to be able to overwrite.
|
|
|
|
symfollow true/false.)
|
|
under traversal. Pass through full flag set in dirtree_add_node(), add
dirtree_start() wrapper to provide symlink-only behavior (avoiding a lot
of DIRTREE_SYMFOLLOW*!!(logic) repeated in callers).
|
|
(I tweaked some comment text while I was there.)
|
|
|
|
(Don't specify the space flag when it's the default behavior. The ifconfig
stuff was actual bugs.)
|
|
have a shortopt for it.
|
|
the end and option parsing fell off the end looking for it (segfault) if DEBUG wasn't enabled to check for that.
|
|
MV still requires CP enabled until the flag generation logic gets updated.
|
|
|
|
|
|
|
|
analysis, plus occasional tweak by me while reviewing them.
|
|
we want to redirect both, one, or neither of stdin/stdout.
|
|
command use that.
-F is equivalent to the gnu/dammit flag --we-think-long-options-without-short-options-are-a-good-idea
|
|
|
|
open, and add dir->again variable to distinguish second call instead of checking for -1 filehandle.
|
|
|
|
|
|
Partly because there's no supplied target string ala sprintf, and partly
because I can never remember what order the m and s go in.
|
|
|