diff options
author | Guido Guenther <agx@sigxcpu.org> | 2007-10-07 13:53:46 +0200 |
---|---|---|
committer | Guido Guenther <agx@sigxcpu.org> | 2007-10-07 13:53:46 +0200 |
commit | fee45b0acd4f9539c438fc6d9d457b64f55928ee (patch) | |
tree | ae5d7c01f20c3e18df457a145cf0deeb192660ae /git-dch | |
parent | 05e29158263faf865f90e75592b26e76b3eb8576 (diff) | |
download | git-buildpackage-fee45b0acd4f9539c438fc6d9d457b64f55928ee.tar.gz git-buildpackage-fee45b0acd4f9539c438fc6d9d457b64f55928ee.tar.bz2 git-buildpackage-fee45b0acd4f9539c438fc6d9d457b64f55928ee.zip |
handle versions containing epochs
Diffstat (limited to 'git-dch')
-rwxr-xr-x | git-dch | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -78,11 +78,15 @@ def head_commit(): def snapshot_version(version): """ get the current release and snapshot version - @FIXME: this causes trouble with epochs + Format is <debian-version>~<release>.gbp<short-commit-id> """ try: - (release, suffix) = version.split('~', 1) - snapshot = int(suffix.split('.',1)[0]) + (release, suffix) = version.rsplit('~', 1) + (snapshot, commit) = suffix.split('.', 1) + if not commit.startswith('gbp'): + raise ValueError + else: + snapshot = int(snapshot) except ValueError: # not a snapshot release release = version snapshot = 0 |