]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
make-dist: don't set Release tag in ceph.spec for SUSE distros 48547/head
authorNathan Cutler <ncutler@suse.com>
Mon, 29 Jan 2018 12:38:08 +0000 (13:38 +0100)
committerTim Serong <tserong@suse.com>
Mon, 24 Oct 2022 22:49:50 +0000 (09:49 +1100)
SUSE's Open Build Service overwrites the Release tag with checkin
and build counters, so we can't use it to record the number of
commits since the last tag, and the last commit hash.  This commit
appends that extra information to the Version tag instead for
SUSE builds.

Fixes: https://tracker.ceph.com/issues/57893
Signed-off-by: Tim Serong <tserong@suse.com>
Signed-off-by: Nathan Cutler <ncutler@suse.com>
make-dist

index f2626871534b47ca6b10133a6c427bb78867d2de..22bf2c98c003bf2786e8392bea831774ac623a91 100755 (executable)
--- a/make-dist
+++ b/make-dist
@@ -168,6 +168,19 @@ echo "including src/.git_version, ceph.spec"
 
 (git rev-parse HEAD ; echo $version) 2> /dev/null > src/.git_version
 
+if [ -r /etc/os-release ]; then
+    source /etc/os-release
+    case $ID in
+        opensuse*|suse|sles)
+            if [ "x$rpm_release" != "x0" ] ; then
+                rpm_release=$(echo $rpm_release | sed 's/.g/+g/')
+                rpm_version="${rpm_version}.${rpm_release}"
+                rpm_release="0"
+            fi
+            ;;
+    esac
+fi
+
 for spec in ceph.spec.in; do
     cat $spec |
         sed "s/@PROJECT_VERSION@/$rpm_version/g" |