From 521002637a7b4e6ad4c48c36b0374fa166e6c866 Mon Sep 17 00:00:00 2001 From: Daniel Gollub Date: Tue, 31 Mar 2015 12:12:17 +0200 Subject: Restore correct version-guessing for -0releases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Closes: gh#10 --- gbp/deb/git.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gbp/deb/git.py') 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 -- cgit v1.2.3