aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/deb/git.py
diff options
context:
space:
mode:
authorDaniel Gollub <dgollub@brocade.com>2015-03-31 12:12:17 +0200
committerGuido Günther <agx@sigxcpu.org>2015-09-01 07:43:22 +0200
commit521002637a7b4e6ad4c48c36b0374fa166e6c866 (patch)
treed6927b95a12d7ba1ac4cb802355490b5b8b07093 /gbp/deb/git.py
parentcd6d7daa84cd3fe5e377bf3622f9e24a356cbe2a (diff)
Restore correct version-guessing for -0releases
With commit 59254996d740b8b8a0db306a7e04950a5f4e51b8 the version guessing behavior changed. gbp dch --release suggested to bump the package version from: 1.0-0vyatta1 to 1.0-1 Old and expected beahviour is: 1.0-0vyatta2 Signed-off-by: Guido Günther <agx@sigxcpu.org> Closes: gh#10
Diffstat (limited to 'gbp/deb/git.py')
-rw-r--r--gbp/deb/git.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/gbp/deb/git.py b/gbp/deb/git.py
index 6d46dec0..65ba4f56 100644
--- a/gbp/deb/git.py
+++ b/gbp/deb/git.py
@@ -65,7 +65,7 @@ class DebianGitRepository(GitRepository):
def debian_version_from_upstream(self, upstream_tag_format,
upstream_branch, commit='HEAD',
- epoch=None):
+ epoch=None, debian_release=True):
"""
Build the Debian version that a package based on upstream commit
I{commit} would carry taking into account a possible epoch.
@@ -76,6 +76,8 @@ class DebianGitRepository(GitRepository):
@type upstream_branch: C{str}
@param commit: the commit to search for the latest upstream version
@param epoch: an epoch to use
+ @param debian_release: If set to C{False} don't append a Debian release
+ number to the version number
@returns: a new debian version
@raises GitRepositoryError: if no upstream tag was found
"""
@@ -83,7 +85,9 @@ class DebianGitRepository(GitRepository):
tag = self.find_branch_tag(commit, upstream_branch, pattern=pattern)
version = self.tag_to_version(tag, upstream_tag_format)
- version += "-1"
+ if debian_release:
+ version += "-1"
+
if epoch:
version = "%s:%s" % (epoch, version)
return version