build:add script to sort netbsd sets and sort minix/mi.

Change-Id: I309d8bbcfe2f5b6d5e1ae7626422c4402985ad1d
This commit is contained in:
Kees Jongenburger 2013-04-19 11:43:26 +02:00 committed by Gerrit Code Review
parent fcb66ed1b5
commit f8dbcfa7f2
2 changed files with 234 additions and 201 deletions

File diff suppressed because it is too large Load diff

26
releasetools/sort_set.sh Executable file
View file

@ -0,0 +1,26 @@
#!/bin/sh
#
# kinda natural sorting for sets
# prepend every line with a modified path where
# slashes are replaced by "1" and "0" is added
# at the end of the string.
#
# entry
# ./bin/cat minix-sys
# becomes
#.1bin1cat0 ./bin/cat minix-sys
#
# This entry gets sorted after wich the key is removed using
# cut
#
# Additionally all lines starting with "#" are put on
# top in the order they where put in the file. this is done
# by creating a "key" with the value COUNTER
#
COUNTER=10000
while read i
do
A=$(echo $i | cut -f 1 -d ' ' | sed "s,^#,00$COUNTER,g" | sed 's,/,1,g' )
echo "${A}0 $i"
COUNTER=$(($COUNTER +1))
done | sort | cut -d ' ' -f 2-