Merge pull request #140 from unixorn/make-package-iteration-iterate
Set release default to the number of commits in the repo instead of always using 1
This commit is contained in:
@@ -22,8 +22,16 @@ shift
|
|||||||
# Defaults that can be overridden:
|
# Defaults that can be overridden:
|
||||||
# All packages are 1.0 unless otherwise specifed:
|
# All packages are 1.0 unless otherwise specifed:
|
||||||
: ${PKGVERSION:=1.0} ;
|
: ${PKGVERSION:=1.0} ;
|
||||||
# If there is no iteration setting, assume "1":
|
# If there is no iteration set, default to use the number of commits in the repository:
|
||||||
: ${PKGRELEASE:=1}
|
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
|
# If there is no epoch, assume 0
|
||||||
: ${PKGEPOCH:=0}
|
: ${PKGEPOCH:=0}
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,16 @@ shift
|
|||||||
# Defaults that can be overridden:
|
# Defaults that can be overridden:
|
||||||
# All packages are 1.0 unless otherwise specifed:
|
# All packages are 1.0 unless otherwise specifed:
|
||||||
: ${PKGVERSION:=1.0} ;
|
: ${PKGVERSION:=1.0} ;
|
||||||
# If there is no iteration setting, assume "1":
|
# If there is no iteration set, default to use the number of commits in the repository:
|
||||||
: ${PKGRELEASE:=1}
|
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
|
# If there is no epoch, assume 0
|
||||||
: ${PKGEPOCH:=0}
|
: ${PKGEPOCH:=0}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user