Until now, the "version" file contained a string like
10.2.5-6244-g9027e75
The RPM version obtained by doing "rpm -q $PKG --qf %{VERSION}-%{RELEASE}"
looks like this: 10.2.5-6244.g9027e75
When teuthology compares these two strings, they don't match even though
the version numbers are effectively the same.
Signed-off-by: Nathan Cutler <ncutler@suse.com>
# a) human readable
# b) is unique for each commit
# c) compares higher than any previous commit
+# WAIT, c) DOES NOT HOLD:
+# >>> print 'v10.2.5-7-g000000' < 'v10.2.5-8-g000000'
+# True
+# >>> print 'v10.2.5-9-g000000' < 'v10.2.5-10-g000000'
+# False
# d) contains the short hash of the commit
#
-vers=$(git describe --match "v*" | sed s/^v//)
+# Regardless, we use it for the RPM version number, but strip the leading 'v'
+# and replace the '-' before the 'g000000' with a '.' to match the output of
+# "rpm -q $PKG --qf %{VERSION}-%{RELEASE}"
+#
+vers=$(git describe --match "v*" | sed -r -e 's/^v//' -e 's/\-([[:digit:]]+)\-g/\-\1\.g/')
ceph_dir=$(pwd)
#