diff options
author | Karel Zak | 2011-07-29 16:12:05 +0200 |
---|---|---|
committer | Karel Zak | 2011-07-29 16:12:05 +0200 |
commit | 54e10ad15f1c4f1797814758752752a47a8c25db (patch) | |
tree | 40a93a750c24324bc64e8f7a7b902b3bbf9086e0 | |
parent | build-sys: release++ (v2.20-rc1) (diff) | |
download | kernel-qcow2-util-linux-54e10ad15f1c4f1797814758752752a47a8c25db.tar.gz kernel-qcow2-util-linux-54e10ad15f1c4f1797814758752752a47a8c25db.tar.xz kernel-qcow2-util-linux-54e10ad15f1c4f1797814758752752a47a8c25db.zip |
build-sys: fix git-version-gen for -rc tags
The current version have a problem to support "v2.20-rc1" format of
the tags.
Signed-off-by: Karel Zak <kzak@redhat.com>
-rwxr-xr-x | tools/git-version-gen | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/git-version-gen b/tools/git-version-gen index 686f7031a..1df20c3bd 100755 --- a/tools/git-version-gen +++ b/tools/git-version-gen @@ -116,6 +116,7 @@ then # Newer: v6.10-77-g0f8faeb # Older: v6.10-g0f8faeb case $v in + *-rc[0-9]) ;; # release candidate *-*-*) : git describe is okay three part flavor ;; *-*) : git describe is older two part flavor @@ -132,9 +133,17 @@ then ;; esac - # Change the first '-' to a '.', so version-comparing tools work properly. - # Remove the "g" in git describe's output string, to save a byte. - v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; + case $v in + *-rc[0-9]) + # Remove the "g" in git describe's output string, to save a byte. + v=`echo "$v" | sed 's/\(.*\)-g/\1-/'`; + ;; + *) + # Change the first '-' to a '.', so version-comparing tools work properly. + # Remove the "g" in git describe's output string, to save a byte. + v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; + ;; + esac v_from_git=1 else v=UNKNOWN |