From: Dan Mick Date: Wed, 5 Oct 2016 18:01:26 +0000 (-0700) Subject: make-dist: set rpm_release correctly for release builds X-Git-Tag: v11.0.1~8^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11334%2Fhead;p=ceph.git make-dist: set rpm_release correctly for release builds Similar to autobuild-ceph 17591db, only try to set rpm_release if there is a release part to the git describe output (i.e. if it's not at a version tag) Signed-off-by: Dan Mick --- diff --git a/make-dist b/make-dist index 5e86eb7d069..acfea8725c3 100755 --- a/make-dist +++ b/make-dist @@ -35,8 +35,18 @@ bin/git-archive-all.sh --prefix ceph-$version/ \ echo "including src/.git_version, src/ceph_ver.h, ceph.spec" src/make_version -g src/.git_version -c src/ceph_ver.h -rpm_version=`echo $version | cut -d - -f 1-1` -rpm_release=`echo $version | cut -d - -f 2- | sed 's/-/./'` +# if the version has '-' in it, it has a 'release' part, +# like vX.Y.Z-N-g. If it doesn't, it's just +# vX.Y.Z. Handle both, and translate - to . for rpm +# naming rules (the - separates version and release). + +if expr index $version '-' > /dev/null; then + rpm_version=`echo $version | cut -d - -f 1-1` + rpm_release=`echo $version | cut -d - -f 2- | sed 's/-/./'` +else + rpm_version=$version + rpm_release=0 +fi cat ceph.spec.in | \ sed "s/@VERSION@/$rpm_version/g" | \