aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Priegnitz <koem@petoria.de>2011-08-31 09:03:12 +0200
committerKarsten Priegnitz <koem@petoria.de>2011-08-31 09:03:12 +0200
commitf083df4fd71ba7da380254dc3d79c4f95628fce1 (patch)
tree323a29dc6fca5b2dcde203e3620e2411e0d4b30a
parent7c2cf7393c32d842fe60d0f1bd8032ccf3ac6517 (diff)
downloadcgeo-f083df4fd71ba7da380254dc3d79c4f95628fce1.zip
cgeo-f083df4fd71ba7da380254dc3d79c4f95628fce1.tar.gz
cgeo-f083df4fd71ba7da380254dc3d79c4f95628fce1.tar.bz2
script to create ID-Mapping array
-rwxr-xr-xproject/attributes/makeGpxIdArray.sh30
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 "};"