| |
@@ -6,15 +6,18 @@
|
| |
|
| |
name=waiverdb
|
| |
if [ "$(git tag | wc -l)" -eq 0 ] ; then
|
| |
- # never been tagged since the project is just starting out
|
| |
- lastversion="0.0"
|
| |
+ # if this is a shallow git clone, get the latest version from spec file
|
| |
+ lastversion="$(sed -n '/^Version:/{s/.*:\s*//;p;q}' waiverdb.spec)"
|
| |
revbase=""
|
| |
+ commitcount=99
|
| |
else
|
| |
lasttag="$(git describe --tags --abbrev=0 HEAD)"
|
| |
lastversion="${lasttag##${name}-}"
|
| |
revbase="^$lasttag"
|
| |
+ commitcount=$(git rev-list "$revbase" HEAD | wc -l)
|
| |
fi
|
| |
- if [ "$(git rev-list $revbase HEAD | wc -l)" -eq 0 ] ; then
|
| |
+
|
| |
+ if [ "$(git rev-list "$revbase" HEAD | wc -l)" -eq 0 ] ; then
|
| |
# building a tag
|
| |
rpmver=""
|
| |
rpmrel=""
|
| |
@@ -25,7 +28,6 @@
|
| |
version="${version%%[a-z]*}" # strip non-numeric suffixes like "rc1"
|
| |
# increment the last portion of the version
|
| |
version="${version%.*}.$((${version##*.} + 1))"
|
| |
- commitcount=$(git rev-list $revbase HEAD | wc -l)
|
| |
commitsha=$(git rev-parse --short HEAD)
|
| |
rpmver="${version}"
|
| |
rpmrel="0.git.${commitcount}.${commitsha}"
|
| |
Why it's 99? :D