diff options
| -rwxr-xr-x | project/attributes/makeGpxIdArray.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/project/attributes/makeGpxIdArray.sh b/project/attributes/makeGpxIdArray.sh new file mode 100755 index 0000000..f348771 --- /dev/null +++ b/project/attributes/makeGpxIdArray.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +require () { + hash $1 2>&- || { echo >&2 "I require $1 but it's not installed. Aborting."; exit 1; } +} + +require sed + +echo "private final int[] CACHE_ATTRIBUTES = {" + +cat iconlist.txt | grep -v "^#" \ + | cut -d "|" -f 1,2 \ + | sed "s/ *$//" \ + | grep "[0-9]$" \ + | sort -nk 3 \ + | sed "s/^\([^ ]*\)[ \|]*\([0-9]*\)$/ R.string.attribute_\1_yes, \/\/ GPX-ID \2/" \ + > $0.tmp + +maxid=`tail -n 1 $0.tmp | sed "s/^.* \([0-9]*\)$/\1/"` + +for n in `seq 0 $maxid`; do + l=`grep " $n$" $0.tmp` + if [ -z "$l" ]; then + echo " -1, // GPX-ID $n" + else + echo "$l" + fi +done + +echo "};" |
