~nabijaczleweli/voreutils

Drop-in Policy-compatible coreutils replacement, at the very least.

83de8da test

a month ago

466ad52 you should know i passed up vore-roleplay as a header for this

2 months ago

#voreutils builds.sr.ht build status Licence

Drop-in Policy-compatible coreutils replacement, at the very least.

This probably wants a better blurb.

GNU coreutils provide the following 105 binaries, according to dpkg -L coreutils | grep bin/ on Buster (8.30-3):

  • ☑ /bin/cat
  • ☐ /bin/chgrp
  • ☐ /bin/chmod
  • ☐ /bin/chown
  • ☐ /bin/cp
  • ☐ /bin/date
  • ☑ /bin/dd
  • ☑ /bin/df
  • ☐ /bin/dir
  • ☑ /bin/echo – -n only
  • ☑ /bin/false
  • ☐ /bin/ln
  • ☐ /bin/ls
  • ☑ /bin/mkdir
  • ☑ /bin/mknod
  • ☑ /bin/mktemp
  • ☐ /bin/mv
  • ☑ /bin/pwd
  • ☐ /bin/readlink
  • ☑ /bin/rm
  • ☑ /bin/rmdir
  • ☑ /bin/sleep
  • ☐ /bin/stty
  • ☑ /bin/sync
  • ☐ /bin/touch
  • ☑ /bin/true
  • ☑ /bin/uname
  • ☐ /bin/vdir
  • ☑ /usr/bin/[ — no V7-style -l string -eq ...
  • ☑ /usr/bin/arch
  • ☑ /usr/bin/b2sum
  • ☑ /usr/bin/base32
  • ☑ /usr/bin/base64
  • ☑ /usr/bin/basename
  • ☐ /usr/bin/chcon
  • ☑ /usr/bin/cksum
  • ☐ /usr/bin/comm
  • ☐ /usr/bin/csplit
  • ☑ /usr/bin/cut – #993258: -d only accepts a single byte, must accept character, #992667: -c doesn't seem to actually take characters?, #992666: -n ignored => mangles output
  • ☐ /usr/bin/dircolors
  • ☑ /usr/bin/dirname
  • ☐ /usr/bin/du
  • ☑ /usr/bin/env – some parsing restrixions might be too strict (-0 in particular), but they match GNU env
  • ☑ /usr/bin/expand
  • ☑ /usr/bin/expr
  • ☑ /usr/bin/factor – only u64 (for now?); could also use -hx from NetBSD? also should maybe include primes(6)
  • ☐ /usr/bin/fmt
  • ☑ /usr/bin/fold
  • ☑ /usr/bin/groups
  • ☑ /usr/bin/head
  • ☑ /usr/bin/hostid
  • ☑ /usr/bin/id
  • ☐ /usr/bin/install
  • ☐ /usr/bin/join
  • ☑ /usr/bin/link
  • ☑ /usr/bin/logname
  • ☑ /usr/bin/md5sum
  • ☑ /usr/bin/mkfifo – https://bugs.debian.org/990962 lole
  • ☑ /usr/bin/nice
  • ☐ /usr/bin/nl
  • ☑ /usr/bin/nohup – GNU nohup resets umask (for no discernible reason?), returns 125 instead of 127 for processing/no-nohup.out (which is wrong!)
  • ☑ /usr/bin/nproc
  • ☐ /usr/bin/numfmt
  • ☐ /usr/bin/od
  • ☑ /usr/bin/paste
  • ☑ /usr/bin/pathchk
  • ☐ /usr/bin/pinky
  • ☐ /usr/bin/pr
  • ☑ /usr/bin/printenv
  • ☑ /usr/bin/printf
  • ☐ /usr/bin/ptx
  • ☐ /usr/bin/realpath
  • ☐ /usr/bin/runcon
  • ☑ /usr/bin/seq
  • ☑ /usr/bin/sha1sum
  • ☑ /usr/bin/sha224sum
  • ☑ /usr/bin/sha256sum
  • ☑ /usr/bin/sha384sum
  • ☑ /usr/bin/sha512sum
  • ☑ /usr/bin/shred – a perfunctory novote
  • ☑ /usr/bin/shuf
  • ☐ /usr/bin/sort
  • ☐ /usr/bin/split
  • ☐ /usr/bin/stat
  • ☑ /usr/bin/stdbuf
  • ☑ /usr/bin/sum
  • ☑ /usr/bin/tac
  • ☐ /usr/bin/tail
  • ☑ /usr/bin/tee – --output-error is multiple levels of wrong
  • ☑ /usr/bin/test — see [
  • ☑ /usr/bin/timeout
  • ☑ /usr/bin/tr – implements -C as -c and [=e=] as e: this matches 4.4BSD and GNU tr, but is nevertheless a missing POSIX feature; could also stand to do buffering lower than fgetc/fputc, as I imagine the overhead of calling those for each byte is noninsignificant locked I/O 33MB/s, unlocked I/O 46.6, GNU tr 180-200
  • ☑ /usr/bin/truncate
  • ☑ /usr/bin/tsort – GNU tsort is turbofucked, and returns 1 for loops
  • ☑ /usr/bin/tty
  • ☑ /usr/bin/unexpand – flag handling is mildly (very?) different, and matches NetBSD; the tests are (should be) representative and all pass, but i've had the worst time of my life writing it, so it's entirely possible (if unlikely) it's not 100% bug-compatible
  • ☐ /usr/bin/uniq
  • ☑ /usr/bin/unlink
  • ☐ /usr/bin/users
  • ☑ /usr/bin/wc
  • ☐ /usr/bin/who
  • ☑ /usr/bin/whoami
  • ☑ /usr/bin/yes
  • ☑ /usr/sbin/chroot
  • ☑ /usr/bin/md5sum.textutils

TODO: re-visit the early utilities' pages

TODO: multicalls should default to something rather than abort when appropriate like netbsd id(1) maybe?

TODO: should posix_fadvise(sequential) where appropriate maybe?

TODO: support SMACK in addition to SELinux? or don't either way, rip it out (rm has it) or add it in

TODO: support TrustedBSD maybe?

TODO: filesize.js-style (include/vore-human) sizing might be a bit suboptimal for this (df) sort of display?

TODO: re-do all .. and ..= ranges as [num, num)

TODO? does "UNIX Programmer's Manual" want to have some part/entirety .Tned

TODO: customisable constant/filesystem/git per-file dates in manuals

TODO: replace ^s with \\(has, where appropriate, for benefit of -Tps.

#Building

You'll need a non-ancient C[++] toolchain, a POSIX AWK, GNU make, and mandoc (linting and HTML manuals only, MANDOC=true to disable).

libb2 and libcrypto are required (searched with pkg-config if available). It'd be just libcrypto if the implementation correctly used the result size in EVP_MD.

libselinux-dev and pkg-config will provide SELinux support.

Run GNU make. See the head of the Makefile for tunables, notably VOREUTILS_{VERSION,DATE}, which are derived from git HEAD by default, OUTDIR (and {CMD,MAN,HTMLMAN}DIR) where artifacts land, and OBJDIR where intermediate objects land; these can all be set independently, SYMLINK, if set to "y", will link binary altnames together symbolically. VOREUTILS_LIB_PREFIX (/usr/lib/voreutils/) is the location of libstdbuf.

#Organisation

Who knows yet!

A .note.version section is included in every output file, and includes the full version and date string.

Unlocked stdio used by default, toggle comment in include/vore-stdio to disable (for testing or otherwise). TODO: temporarily permanently disabled for testing; enable later.

Enable in-line eqn(1) with

.EQ
delim %%
.EN

(or whichever delimiter is best) after .Sh DESCRIPTION and disable it at the end.

If typesetting something that doesn't work in nroff mode (like the big equations in base64.1) provide an .ie n/.el alternative in .Fn-like syntax; otherwise (like the polynomial in cksum.1) enable eqn(1) preprocessing in man(1) by starting with '\" e.

If typesetting something that doesn't work in troff mode, prefer .ie t (cf. pathchk.1).

In mandoc delimited eqn(1) breaks conditionals, wrap them in braces (.el \{ [text] % eqn % [text] \}).

#Compatibility

Free UNIXes, hopefully. Debian, OpenBSD, and FreeBSD are on CI, as normal, bare, and fucked baselines, respectively. I also test on NetBSD (and TODO: some Illumos distro) before release.

#Contributing

Send a patch inline, as an attachment, or a git link and a ref to pull from to the list (~nabijaczleweli/voreutils@lists.sr.ht) or me directly. I'm not picky, just please include the repo name in the subject prefix.

#Discussion

Please use the tracker, the list, or Twitter.

#Licences

Except where noted otherwise (e.g. in the headers of files from NetBSD), all contents of this repository are subject to the 0-clause BSD licence.

#Special thanks

To all who support further development on Patreon, in particular:

  • ThePhD
  • Embark Studios