diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2015-03-17 14:55:06 -0400 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2015-03-18 19:34:22 +0100 |
commit | cb03293bd7e95e3e6a56947dff79c2afad8e3701 (patch) | |
tree | 1c54ad73449bff3897204ffd7953ab22b91d59e9 | |
parent | 83c5cc5a8556527863ffd0972244e33869d47f4b (diff) |
Add %(hversion)s to version_to_tag to support some upstreams
enigmail upstream uses tags named enigmail-1-8 for 1.8. Other
upstreams have used similar conventions, likely as holdovers from CVS
(e.g. gnupg 1.4.2 was tagged with V1-4-2). This patch helps packagers
work with these upstreams.
Closes: #780679
Signed-off-by: Guido Günther <agx@sigxcpu.org>
-rw-r--r-- | gbp/deb/git.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gbp/deb/git.py b/gbp/deb/git.py index 2a848d4..7746e86 100644 --- a/gbp/deb/git.py +++ b/gbp/deb/git.py @@ -102,10 +102,20 @@ class DebianGitRepository(GitRepository): def version_to_tag(format, version): """Generate a tag from a given format and a version + %(version)s provides a clean version that works as a git tag. + + %(hversion)s provides the same thing, but with '.' replaced + with '-'. hversion is useful for upstreams with tagging + policies that prohibit . characters. + >>> DebianGitRepository.version_to_tag("debian/%(version)s", "0:0~0") 'debian/0%0_0' + >>> DebianGitRepository.version_to_tag("libfoo-%(hversion)s", "1.8.1") + 'libfoo-1-8-1' + """ - return format_msg(format, dict(version=DebianGitRepository._sanitize_version(version))) + return format_msg(format, dict(version=DebianGitRepository._sanitize_version(version), + hversion=DebianGitRepository._sanitize_version(version).replace('.','-'))) @staticmethod def _sanitize_version(version): |