diff options
author | Monty Taylor <mordred@inaugust.com> | 2014-12-13 12:24:41 -0800 |
---|---|---|
committer | Jeremy Stanley <fungi@yuggoth.org> | 2014-12-14 00:20:33 +0000 |
commit | 1c89d18b6beecade6b7c9007b324e8cf0f486e22 (patch) | |
tree | 660efafc12e2aae0fdf7d5bb3c639cdb93e81812 | |
parent | ee94082d4884dafea419c321bec40aa22244d07f (diff) | |
download | pbr-1c89d18b6beecade6b7c9007b324e8cf0f486e22.tar.gz |
Prefix git suffixes with + instead of .0.10.1
setuptools 8.0 enforces the accepted version of PEP440, which means
that 1.2.3.g123456 is now sorted before 1.0. Forget for a second that
under no obvious human inspection this makes sense, it is now the law of
the land and we must comply.
I swear to god I'm going to start coding in Go.
Change-Id: I2a5072d73e19ce77fa29ba5d8aa6e9649859a551
(cherry picked from commit fafd6c4db07789b2d378fdb5ceda89115d2abe30)
-rw-r--r-- | pbr/packaging.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py index 471ed85..44c14cc 100644 --- a/pbr/packaging.py +++ b/pbr/packaging.py @@ -809,10 +809,11 @@ def _get_version_from_git(pre_version): except Exception: sha = _run_git_command( ['log', '-n1', '--pretty=format:%h'], git_dir) - return "%s.dev%s.g%s" % (pre_version, _get_revno(git_dir), sha) + return "%s.dev%s+g%s" % (pre_version, _get_revno(git_dir), sha) else: return _run_git_command( - ['describe', '--always'], git_dir).replace('-', '.') + ['describe', '--always'], + git_dir).replace('-', '.').replace('.g', '+g') # If we don't know the version, return an empty string so at least # the downstream users of the value always have the same type of # object to work with. |