@@ -6,22 +6,29 @@ DEF_VER=v1.8.4 LF=' '-# First see if there is a version file (included in release tarballs),-# then try git-describe, then default.-if test -f version-then- VN=$(cat version) || VN="$DEF_VER"-elif test -d ${GIT_DIR:-.git} -o -f .git &&- VN=$(git describe --match "v[0-9]*" --abbrev=7 HEAD 2>/dev/null) &&+describe () {+ VN=$(git describe --match "v[0-9]*" --abbrev=7 HEAD 2>/dev/null) || return 1 case "$VN" in- *$LF*) (exit 1) ;;+ *$LF*)+ return 1+ ;; v[0-9]*) git update-index -q --refresh test -z "$(git diff-index --name-only HEAD --)" ||- VN="$VN-dirty" ;;+ VN="$VN-dirty"+ return 0+ ;; esac+}++# First see if there is a version file (included in release tarballs),+# then try 'git describe', then default.+if test -f version+then+ VN=$(cat version) || VN="$DEF_VER"+elif test -d ${GIT_DIR:-.git} -o -f .git && describe then- VN=$(echo "$VN" | sed -e 's/-/./g');+ VN=$(echo "$VN" | sed -e 's/-/./g') else VN="$DEF_VER" fi
From: Felipe Contreras <hidden> Date: 2016-06-15 22:58:45
The current versioning scheme doesn't work properly:
git-1.8.4 < git-1.8.4.rc1
git-1.8.4 < git-1.8.4-rc1
git-1.8.4 > git-1.8.4~rc1
Since v1.8.4 final is obviously greater than v1.8.4-rc1, we need to use
a tilde so RPM detects it properly as a greater version number.
This works in rpm-4.10, in older versions, a tilde would work as bad as
anything else.
Signed-off-by: Felipe Contreras <redacted>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Felipe Contreras <hidden> Date: 2016-06-15 22:58:46
If the version is 'v1.8.4-rc1' that is the version, and there's no need
to change it to anything else, like 'v1.8.4.rc1'.
If RedHat, or somebody else, needs a specific version, they can use the
'version' file, like everybody else.
Signed-off-by: Felipe Contreras <redacted>
---
GIT-VERSION-GEN | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
@@ -26,10 +26,8 @@ describe () { if test -f version then VN=$(cat version) || VN="$DEF_VER"-elif test -d ${GIT_DIR:-.git} -o -f .git && describe+elif test ! -d ${GIT_DIR:-.git} -a ! -f .git || ! describe then- VN=$(echo "$VN" | sed -e 's/-/./g')-else VN="$DEF_VER" fi