version/gitvars: use redo-always if using git commands.

Otherwise we won't rebuild files when the commit id changes.
This commit is contained in:
Avery Pennarun 2011-01-18 00:55:25 -08:00
commit 5ea0cb01f5
2 changed files with 6 additions and 1 deletions

View file

@ -1,6 +1,7 @@
redo-ifchange gitvars.pre prodname
read PROD <prodname
exec >$3
# Fix each line from gitvars.pre where git may or may not have already
# substituted the variables. If someone generated a tarball with 'git archive',
@ -12,6 +13,7 @@ while read line; do
x=${line#\$Format:} # remove prefix
if [ "$x" != "$line" ]; then
# git didn't substitute it
redo-always # git this from the git repo
x=${x%\$} # remove trailing $
if [ "$x" = "%d" ]; then
tag=$(git describe --match="$PROD-*")
@ -22,3 +24,5 @@ while read line; do
fi
echo "$x"
done <gitvars.pre
redo-stamp <$3