mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
build: fix bashisms
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
7448914304
commit
41b4214d18
1 changed files with 14 additions and 11 deletions
|
@ -5,22 +5,25 @@
|
|||
#
|
||||
# TODO: proper error handling
|
||||
|
||||
die() {
|
||||
echo "$0: WARNING: version stamp update failed."
|
||||
#exit 1 # not important enough to stop the build.
|
||||
exit 0
|
||||
die()
|
||||
{
|
||||
echo "$0: WARNING: version stamp update failed."
|
||||
#exit 1 # not important enough to stop the build.
|
||||
exit 0
|
||||
}
|
||||
|
||||
STAMP=`cat "$1" 2> /dev/null`
|
||||
CURRENT=`git-describe 2>/dev/null`
|
||||
|
||||
if [[ -z "$STAMP" || -z "$CURRENT" ]]; then
|
||||
die
|
||||
if [ -z "$STAMP" -o -z "$CURRENT" ]
|
||||
then
|
||||
die
|
||||
fi
|
||||
|
||||
if [ "$STAMP" != "$CURRENT" ]; then
|
||||
echo "git version changed: $STAMP -> $CURRENT"
|
||||
sed -e s/$STAMP/$CURRENT/g "$2" 1> "$2.new" || die
|
||||
mv "$2.new" "$2"
|
||||
echo -n "$CURRENT" > "$1"
|
||||
if [ "$STAMP" != "$CURRENT" ]
|
||||
then
|
||||
echo "git version changed: $STAMP -> $CURRENT"
|
||||
sed -e s/$STAMP/$CURRENT/g "$2" 1> "$2.new" || die
|
||||
mv "$2.new" "$2"
|
||||
echo -n "$CURRENT" > "$1"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue