build: fix bashisms
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
7448914304
commit
41b4214d18
|
@ -5,7 +5,8 @@
|
||||||
#
|
#
|
||||||
# TODO: proper error handling
|
# TODO: proper error handling
|
||||||
|
|
||||||
die() {
|
die()
|
||||||
|
{
|
||||||
echo "$0: WARNING: version stamp update failed."
|
echo "$0: WARNING: version stamp update failed."
|
||||||
#exit 1 # not important enough to stop the build.
|
#exit 1 # not important enough to stop the build.
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -14,11 +15,13 @@ die() {
|
||||||
STAMP=`cat "$1" 2> /dev/null`
|
STAMP=`cat "$1" 2> /dev/null`
|
||||||
CURRENT=`git-describe 2>/dev/null`
|
CURRENT=`git-describe 2>/dev/null`
|
||||||
|
|
||||||
if [[ -z "$STAMP" || -z "$CURRENT" ]]; then
|
if [ -z "$STAMP" -o -z "$CURRENT" ]
|
||||||
|
then
|
||||||
die
|
die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$STAMP" != "$CURRENT" ]; then
|
if [ "$STAMP" != "$CURRENT" ]
|
||||||
|
then
|
||||||
echo "git version changed: $STAMP -> $CURRENT"
|
echo "git version changed: $STAMP -> $CURRENT"
|
||||||
sed -e s/$STAMP/$CURRENT/g "$2" 1> "$2.new" || die
|
sed -e s/$STAMP/$CURRENT/g "$2" 1> "$2.new" || die
|
||||||
mv "$2.new" "$2"
|
mv "$2.new" "$2"
|
||||||
|
|
Loading…
Reference in New Issue