Skip to content

Commit

Permalink
build-sys: fix git-version-gen for -rc tags
Browse files Browse the repository at this point in the history
The current version have a problem to support "v2.20-rc1" format of
the tags.

Signed-off-by: Karel Zak <kzak@redhat.com>
  • Loading branch information
karelzak committed Jul 29, 2011
1 parent d6fc523 commit 54e10ad
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tools/git-version-gen
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 54e10ad

Please sign in to comment.