Recognize git version from tarball name if everything else fails

This commit is contained in:
Sebastian Messmer 2016-03-02 14:13:43 +01:00
parent 3826064d1d
commit 3f66c7ceda
3 changed files with 6 additions and 4 deletions

4
.gitignore vendored
View File

@ -5,5 +5,5 @@ umltest.status
/.idea
*~
gitversion/*.pyc
gitversion/__pycache__
src/gitversion/*.pyc
src/gitversion/__pycache__

View File

@ -108,7 +108,8 @@ def versions_from_parentdir(parentdir_prefix, root, verbose):
Source tarballs conventionally unpack into a directory that includes
both the project name and a version string.
"""
dirname = os.path.basename(root)
# -- (MESSMER) CHANGED FOLLOWING LINE TO LOOK IN ../.. instead of . --
dirname = os.path.basename(os.path.abspath(os.path.join(os.path.join(root, '..'), '..')))
if not dirname.startswith(parentdir_prefix):
if verbose:
print("guessing rootdir is '%s', but '%s' doesn't start with "

View File

@ -590,7 +590,8 @@ def versions_from_parentdir(parentdir_prefix, root, verbose):
Source tarballs conventionally unpack into a directory that includes
both the project name and a version string.
"""
dirname = os.path.basename(root)
# -- (MESSMER) CHANGED FOLLOWING LINE TO LOOK IN ../.. instead of . --
dirname = os.path.basename(os.path.abspath(os.path.join(os.path.join(root, '..'), '..')))
if not dirname.startswith(parentdir_prefix):
if verbose:
print("guessing rootdir is '%%s', but '%%s' doesn't start with "