Deal with being built within a burst tarball instead of a git clone

This commit is contained in:
Joe Block
2016-02-27 06:50:50 -08:00
parent 982f2f0045
commit 673eaae95b
2 changed files with 10 additions and 0 deletions

View File

@@ -25,6 +25,11 @@ shift
# If there is no iteration set, default to use the number of commits in the repository:
if [[ -z "${PKGRELEASE}" ]]; then
PKGRELEASE=$(git rev-list HEAD --count)
if [[ $? != 0 ]]; then
# We're not in a git repo, fall back to 1 so we cope with being built from
# a tarball
PKGRELEASE=1
fi
fi
# If there is no epoch, assume 0