Use tuple comparison, not LooseVersion

This commit is contained in:
rallytime 2015-01-26 10:37:49 -07:00
parent 9dd00b447e
commit 50b99a5902

View File

@ -238,24 +238,16 @@ def _verify_dulwich(quiet=False):
log.error(_RECOMMEND_PYGIT2)
return False
# Get version of dulwich and convert it from a tuple of ints to a string
version = []
dulwich_version = dulwich.__version__
for ver_num in dulwich_version:
version.append(str(ver_num))
version_str = '.'.join(version)
dulwich_ver = distutils.version.LooseVersion(version_str)
dulwich_minver_str = '0.9.4'
dulwich_minver = distutils.version.LooseVersion(dulwich_minver_str)
dulwich_min_version = (0, 9, 4)
errors = []
if dulwich_ver < dulwich_minver:
if dulwich_version < dulwich_min_version:
errors.append(
'Git fileserver backend is enabled in the master config file, but '
'the installed version of Dulwich is earlier than {0}. Version {1} '
'detected.'.format(dulwich_minver_str, dulwich.__version__)
'detected.'.format(dulwich_min_version, dulwich_version)
)
if HAS_PYGIT2 and not quiet: