summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-11-28 21:21:31 +0000
committerCarl Hetherington <cth@carlh.net>2018-11-28 21:21:31 +0000
commit4552f41523a93cd4c3888d1af5e089d7d352a71b (patch)
treeff5f3ae6d5de517c575bcade31c43938f252a8d2
parente524e6beb7ad4c511b88b6cef7429c929a528370 (diff)
Fix packaging on non-releases.
-rwxr-xr-xcdist12
1 files changed, 10 insertions, 2 deletions
diff --git a/cdist b/cdist
index 7c8098c..1e71b46 100755
--- a/cdist
+++ b/cdist
@@ -260,7 +260,6 @@ def set_version_in_wscript(version):
s = l.split()
if len(s) == 3 and s[0] == "VERSION":
- print("Writing %s" % version)
print("VERSION = '%s'" % version, file=o)
else:
print(l, file=o, end="")
@@ -349,6 +348,14 @@ class Version:
else:
self.micro = 0
+ @classmethod
+ def from_git_tag(cls, tag):
+ bits = tag.split('-')
+ c = cls(bits[0])
+ if int(bits[1]) > 0:
+ c.devel = True
+ return c
+
def bump_minor(self):
self.minor += 1
self.micro = 0
@@ -870,7 +877,8 @@ class Tree(object):
try:
self.version = Version(v)
except:
- self.version = Version(subprocess.Popen(shlex.split('git -C %s describe --tags --abbrev=0' % proj), stdout=subprocess.PIPE).communicate()[0][1:])
+ tag = subprocess.Popen(shlex.split('git -C %s describe --tags' % proj), stdout=subprocess.PIPE).communicate()[0][1:]
+ self.version = Version.from_git_tag(tag)
os.chdir(cwd)