From da5709494710925cf9d35b91ba2690148031b840 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 12 May 2008 01:23:19 -0500 Subject: Sort was including the trailing comma and getting the order wrong. (Specifically, it was comparing "sh," with "sha1sum," and putting sha1sum first in generated/newtoys.h so the binary search wasn't finding sha1sum. Alas, you can't feed separate beginning and ending delimiters to "sort -t". The fix is to copy the appropriate field out with sed, duplicate it at the start of the string where it's easy to compare, and then remove it again with a second sed after the sort. --- scripts/make.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/make.sh b/scripts/make.sh index 2e7fd3b6..6d31a5e8 100755 --- a/scripts/make.sh +++ b/scripts/make.sh @@ -22,7 +22,8 @@ function newtoys() done } echo "NEWTOY(toybox, NULL, 0)" > generated/newtoys.h -newtoys | sort -t '(' -k3,3 >> generated/newtoys.h +newtoys | sed 's/\(.*TOY(\)\([^,]*\),\(.*\)/\2 \1\2,\3/' | sort -k 1,1 \ + | sed 's/[^ ]* //' >> generated/newtoys.h # Extract global structure definitions from toys/*.c -- cgit v1.2.3