[Toybox] [PATCH] roadmap: describe glibc commands
Rob Landley
rob at landley.net
Sat Apr 12 18:37:17 PDT 2014
On 04/11/14 11:58, Isaac Dunham wrote:
> roadmap: describe glibc commands.
>
> Some glibc commands are irrelevant because they're for functionality
> that is excluded from musl (mtrace, rpc*, localedef, iconvconfig, nscd).
> getconf and catchsegv look like candidates for the development toolchain;
> locale and iconv were already triaged.
> getent is pretty lame, but it and the timezone stuff (tzselect zic
> zdump) are the only new possibly interesting commands.
>
> --
> getent is lame because it (a) only handles a hardcoded list of
> passwd-style databases (all of them located in /etc), and
> (b) all it does is dump all contents or retrieve the exact contents of
> the line beginning with a key.
Which grep can do.
> This (untested) shell script is roughly equivalent to getent
> (apart from the lack of error/sanity checking):
>
> if [ -n "$2" ]
> then
> cat /etc/$1
> else
> grep "^$2:" /etc/$1
> fi
>
> Of course, it would be trivial to write if you want to include getent.
Nah, I'm pretty happy to wait for people to complain about a lack, and
then figure out if it's our problem or musl's. :)
I note that musl could in theory multiplex its ld and thus add more
commands. It would be sort of insane to do so, but most of this list is
standard FSF debris.
As for your 4 interesting commands: getent is hilariously limited, has
no standard, and is trivially replacable by grep. If toolbox had one I'd
be interested (since their user/login data is stored in the Windows
Registry instead of /etc), but it doesn't.
Out of sheer curiosity: is anything currently using it?
for i in $(echo $PATH | sed 's/:/ /g'); \
do grep -l getent $i/* 2>/dev/null; done | xargs
/usr/sbin/guest-account /usr/bin/cal /usr/bin/ex /usr/bin/getent
/usr/bin/info /usr/bin/infobrowser /usr/bin/less /usr/bin/ncal
/usr/bin/pager /usr/bin/pstree /usr/bin/pstree.x11 /usr/bin/rview
/usr/bin/screen /usr/bin/ul /usr/bin/vi /usr/bin/view /usr/bin
/vim.tiny /bin/bash /bin/less /bin/rbash
Yes, apparently. The "guest-account" script is some _insane_ ubuntu
thing. Why would _cal_ using it? (Ah, it isn't, it just has a tgetent
function that shows up in the elf tables.) Info is trash... A bsd
underlining command? In any case, no loss here for not implementing it.
tzselect is a 326 line shell script that sounds like it can stay a
script. It really belongs in installers, not in glibc. And musl has no
need to use the gnu timezone format. (uClibc didn't.)
zdump shows up in luatex, a version of tex with an embedded lua
interpreter. Why is this on my system? (Back when I cared about "make
htmldocs", probably. The kernel.org guys' incapability of restoring
rsync access so I could post the updated output for _two_years_ eroded
my enthusiasm for that.)
And zic is also glibc's timezone format, which uClibc doesn't use and
musl isn't required to either. Ideally there would be an external
timezone project... Ah, there is:
http://www.iana.org/time-zones
And I'm told the iana version even includes some of these commands that
the FSF has gratuitously copied...
So having confirmed that none of the commands are of interest for toybox
to implement (until somebody pipes up and says they need them), I'm
updating the roadmap to say that.
Rob
1397353037.0
More information about the Toybox
mailing list