Skip to content

Commit f3284bb

Browse files
committed
Introduce a new "VERSION_RELEASE" template string for the "genversion" script. Also, the "VERSION_FULL" will no longer contain the release number in it
1 parent 93da030 commit f3284bb

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

genversion.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ def __init__(self, major, minor, patch, miniPatch=None, release=None):
4444
self.minor = minor
4545
self.patch = patch
4646
self.miniPatch = miniPatch
47-
self.release = release
47+
self.release = 1
48+
49+
if self.miniPatch is None and release:
50+
self.release = release
4851

4952
if self.patch == None: assert self.miniPatch == None
50-
if self.miniPatch != None: assert self.release == None
5153

5254
def toString(self):
5355
ret = "{0}.{1}".format(self.major, self.minor)
@@ -58,9 +60,6 @@ def toString(self):
5860
if self.miniPatch is not None:
5961
ret += ".{0}".format(self.miniPatch)
6062

61-
if self.release is not None:
62-
ret += "-{0}".format(self.release)
63-
6463
return ret
6564

6665
class GitDescribe:
@@ -86,7 +85,7 @@ def parse(self):
8685
potentialHash = parts.split("-")
8786
if potentialHash and potentialHash[-1].startswith("g"):
8887
self.commitHash = potentialHash[-1][1:]
89-
parts = parts[0:(len(parts) - len(self.commitHash) - 2 )]
88+
parts = parts[0:(len(parts) - len(self.commitHash) - 2)]
9089

9190
# Is there a number of commits since tag? Can only exist if hash has been
9291
# found already.
@@ -97,11 +96,11 @@ def parse(self):
9796
parts = parts[0:(len(parts) - len(tmp[-1]) - 1)]
9897

9998
# Do we have a release version? (e.g.: R_0_8_x-2)
100-
# Set release version only for tags (no commit hash present)
99+
# Note: release version is taken into account only for tags (no commit hash present)
101100
self.release = None
102101
tmp = parts.split("-")
103102
if len(tmp) == 2:
104-
self.release = int(tmp[-1]) if not self.commitHash else None
103+
self.release = int(tmp[-1])
105104
parts = parts[0:(len(parts) - len(tmp[-1]) - 1)]
106105

107106
# Are we using "_", ".", or "-" as delimiter?
@@ -258,6 +257,7 @@ def main():
258257
["@VERSION_MINOR@", softwareVersion.minor],
259258
["@VERSION_PATCH@", softwareVersion.patch],
260259
["@VERSION_MINIPATCH@", softwareVersion.miniPatch],
260+
["@VERSION_RELEASE@", softwareVersion.release],
261261
["@VERSION_FULL@", softwareVersion.toString()]
262262
]
263263

packaging/davix.spec.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
Name: davix
55
Version: @VERSION_FULL@
6-
Release: 1%{?dist}
6+
Release: @VERSION_RELEASE@%{?dist}
77
Summary: Toolkit for HTTP-based file management
88
License: LGPLv2+
99
URL: https://dmc-docs.web.cern.ch/dmc-docs/davix.html

packaging/make-deb.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ cp -r packaging/debian "${BUILD_ARENA}/davix-${VERSION_FULL}"
3737
# releases, the changelog has been updated already by the release script.
3838
#-------------------------------------------------------------------------------
3939
MINIPATCH=$(./genversion.py --template-string "@VERSION_MINIPATCH@")
40+
RELEASE=$(./genversion.py --template-string "@VERSION_RELEASE@")
4041

4142
if [[ ! -z "$MINIPATCH" ]]; then
4243
pushd "${BUILD_ARENA}/davix-${VERSION_FULL}/debian"
4344

4445
CURRENT_DATE=$(date -R)
45-
echo "davix (${VERSION_FULL}-1) unstable; urgency=low" >> patched-changelog
46+
echo "davix (${VERSION_FULL}-${RELEASE}) unstable; urgency=low" >> patched-changelog
4647
echo "" >> patched-changelog
4748
echo " * CI build, update to version ${VERSION_FULL}" >> patched-changelog
4849
echo "" >> patched-changelog

0 commit comments

Comments
 (0)