[Toybox] awk seen in the wild

Rob Landley rob at landley.net
Thu Jul 14 15:30:08 PDT 2016


On 07/13/2016 05:38 PM, enh wrote:
> looks like i never sent my previous patch to the list, and looks like i
> lost it on disk too. (it's probably still *somewhere*, but at some point
> it's cheaper to stop looking and just do it again...)
> 
> attached is a rewrite that shows the basic idea, but misses the step of
> refactoring your portable implementation to look like the libcrypto one
> so we can remove the 10 lines of duplication. (the majority of the lines
> added to this patch is just the same help text duplicated over and over.)
> 
> this actually makes toybox faster than the version in ubuntu 14.04.

The md5sum -c stuff I just checked in means this patch doesn't remotely
apply to current, so I'm doing my cleanup while reimplementing the bits
that need changing anyway.

One advantage of OLDTOY() is that multiple commands share help text,
which kinda comes up here. :) I had problems building oldtoys standalone
but I think I fixed them, and if there's still issues I should deal with
them rather than repeating the same largeish block of help text a half
dozen times. (Larger for me than it was for you because I added -c.)

(I pondered adding some sort of macro substitution so the three
differing places in the text could be swapped and noped right back out
of there. I still need to fix the hep text collation so pgrep and such
show their common parts properly, but complicating it more seems like a
bad idea.)

> The fallback portable C implementations could easily be refactored
> to be API-compatible, but I don't know whether they'd stay here or
> move to lib/ so I've left that part alone for now.

Hmmm... Probably move them to lib. md5sum would be needed by rsync,
sha1sum would be needed by git/repo. Both are post-1.0, but still...

Rob


More information about the Toybox mailing list