Set release default to the number of commits in the repo instead of always using 1

This commit is contained in:
Joe Block
2016-02-26 14:38:12 -08:00
parent 9013350a68
commit 982f2f0045
2 changed files with 12 additions and 6 deletions

View File

@@ -22,8 +22,11 @@ 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)
fi
# If there is no epoch, assume 0 # If there is no epoch, assume 0
: ${PKGEPOCH:=0} : ${PKGEPOCH:=0}
@@ -51,7 +54,7 @@ cat """$@""" | while read -a arr ; do
DST="$OUTPUTDIR/installroot/${arr[1]}" DST="$OUTPUTDIR/installroot/${arr[1]}"
SRC="${arr[2]}" SRC="${arr[2]}"
if [[ $SRC == "cmd/"* || $SRC == *"/cmd/"* ]]; then if [[ $SRC == "cmd/"* || $SRC == *"/cmd/"* ]]; then
( cd $(dirname "$SRC" ) && go build -a -v ) ( cd $(dirname "$SRC" ) && go build -a -v )
fi fi
install -D -T -b -m "$PERM" -T "$SRC" "$DST" install -D -T -b -m "$PERM" -T "$SRC" "$DST"
done done

View File

@@ -22,8 +22,11 @@ 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)
fi
# If there is no epoch, assume 0 # If there is no epoch, assume 0
: ${PKGEPOCH:=0} : ${PKGEPOCH:=0}
@@ -51,7 +54,7 @@ cat """$@""" | while read -a arr ; do
DST="$OUTPUTDIR/installroot/${arr[1]}" DST="$OUTPUTDIR/installroot/${arr[1]}"
SRC="${arr[2]}" SRC="${arr[2]}"
if [[ $SRC == "cmd/"* || $SRC == *"/cmd/"* ]]; then if [[ $SRC == "cmd/"* || $SRC == *"/cmd/"* ]]; then
( cd $(dirname "$SRC" ) && go build -a -v ) ( cd $(dirname "$SRC" ) && go build -a -v )
fi fi
install -D -T -b -m "$PERM" -T "$SRC" "$DST" install -D -T -b -m "$PERM" -T "$SRC" "$DST"
done done