~nabijaczleweli/voreutils

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

80ac3ee Add basename and dirname

2 days ago

ac87a0e Manpage update by job 557972

2 days 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/:

  • ☐ /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/[
  • ☑ /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
  • ☐ /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
  • ☐ /usr/bin/test
  • ☑ /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
  • ☑ /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: multicalls should default to something rather than abort when appropriate like netbsd id(1) maybe?

TODO: should posix_fadvise(sequential) where appropriate maybe?

TODO: should fread_unlocked(sequential) where appropriate maybe?

TODO: support SMACK in addition to SELinux

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

#Building

You'll need a non-ancient C[++] toolchain, a POSIX AWK, GNU make, and mandoc (optional, which may change, confer nomandoc target).

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.

#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