[Toybox] awk-removal-patch (was: Looking at nl)

Rob Landley rob at landley.net
Mon May 27 23:34:55 PDT 2013


On 05/28/2013 01:11:18 AM, Bastian Bittorf wrote:
> * Rob Landley <rob at landley.net> [28.05.2013 07:51]:
> > To build a self-bootstrapping system? Yes, autoconf and the gcc  
> build
> > are full of awk.
> 
> just did a 'git grep awk' in autoconf, and it's full of
> "echo $bla | awk '{print $3}'" - no serious scripting is done
> and this should be replaceable with sh calls:

Autoconf is useless, yes. It's also block copied into 8 gazillion  
packages so upgrading it upstream buys you nothing for several years.

> set -- $bla; echo $3
> 
> or a sh-function to avoid arg-variable mixups.
> 
> i will look into GCC later 8-) bye, bastian

Let's look at the Linux kernel source, shall we?

$ find . -type f | grep -v '[.]git' | xargs grep -w AWK | wc
      23     198    1841
$ find . -name "*.awk" | wc
       6       6     207
$ grep AWK Makefile
AWK		= awk
export MAKE AWK GENKSYMS INSTALLKERNEL PERL UTS_MACHINE
	$(Q)$(AWK) '!x[$$0]++'  
$(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
	$(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin

This is by no means all the use of awk. (arch/arm/tools/gen-mach-types  
for example.)

You are not attempting a realistic goal, and you're arguing against a  
posix command. (I haven't even pushed my bc removal patch, because  
although the use of bc was totally gratuitous and actually kind of  
stupid, forced Linux From Scratch to change its build instructions for  
no good reason, and breaks building with busybox, it is technically  
posix. So I fix it by adding it to toybox.)

Rob


More information about the Toybox mailing list