X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=picodrive.git;a=blobdiff_plain;f=platform%2Fpandora%2Fmake_pxml.sh;h=2267c14a436717e5a00beb3567925a8f91158dda;hp=875c79140bb444bacfdeab9ad156e1a9dc6e09b1;hb=68af34fe20d7d9658100668f86a87bf73506bcb4;hpb=92dfd9afa6e06a071c2e025ff7e0d4f1824a5e8d diff --git a/platform/pandora/make_pxml.sh b/platform/pandora/make_pxml.sh index 875c791..2267c14 100755 --- a/platform/pandora/make_pxml.sh +++ b/platform/pandora/make_pxml.sh @@ -1,10 +1,17 @@ #!/bin/sh -sed -i +set -e -major=`head -n 1 version.h | sed 's/.*"\([0-9]*\)\.\([0-9]*\).*/\1/g'` -minor=`head -n 1 version.h | sed 's/.*"\([0-9]*\)\.\([0-9]*\).*/\2/g'` -revision=`head -n 1 revision.h | sed 's/.*"\([0-9]*\)".*/\1/g'` +verfile=../common/version.h +test -f $verfile + +major=`head -n 1 $verfile | sed 's/.*"\([0-9]*\)\.\([0-9]*\).*/\1/g'` +minor=`head -n 1 $verfile | sed 's/.*"\([0-9]*\)\.\([0-9]*\).*/\2/g'` +# lame, I know.. +build=`git describe HEAD | grep -- - | sed -e 's/.*\-\(.*\)\-.*/\1/'` +test -n "$build" || build=0 + +trap "rm -f $2" ERR sed 's/@major@/'$major'/' "$1" > "$2" sed -i 's/@minor@/'$minor'/' "$2" -sed -i 's/@revision@/'$revision'/' "$2" +sed -i 's/@build@/'$build'/' "$2"