X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fpandora%2Fmake_pxml.sh;h=2fcf8334bc303c6d762baeea6b8119d4d2923cfa;hb=ee5d41a1edcfd0ac2fece688df2d476628a8b333;hp=875c79140bb444bacfdeab9ad156e1a9dc6e09b1;hpb=ab61cff780f6b4b6a632305143845b2903ccd4b9;p=picodrive.git diff --git a/platform/pandora/make_pxml.sh b/platform/pandora/make_pxml.sh index 875c791..2fcf833 100755 --- a/platform/pandora/make_pxml.sh +++ b/platform/pandora/make_pxml.sh @@ -1,10 +1,20 @@ -#!/bin/sh -sed -i +#!/bin/bash +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 -sed 's/@major@/'$major'/' "$1" > "$2" -sed -i 's/@minor@/'$minor'/' "$2" -sed -i 's/@revision@/'$revision'/' "$2" +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_post="-$build" +test -n "$build" || build=0 + +trap "rm -f $2" ERR + +sed -e 's/@major@/'$major'/' \ + -e 's/@minor@/'$minor'/' \ + -e 's/@build@/'$build'/' \ + -e 's/@build_post@/'$build_post'/' \ + "$1" > "$2"