forked from openlp/openlp
check_dependencies.py fails on version numbers with letters (bug #1095699)
bzr-revno: 2128 Fixes: https://launchpad.net/bugs/1095699
This commit is contained in:
commit
6abfdc4215
@ -38,6 +38,7 @@ modules, simply run this script::
|
|||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from distutils.version import LooseVersion
|
||||||
|
|
||||||
is_win = sys.platform.startswith('win')
|
is_win = sys.platform.startswith('win')
|
||||||
|
|
||||||
@ -89,15 +90,13 @@ OPTIONAL_MODULES = [
|
|||||||
w = sys.stdout.write
|
w = sys.stdout.write
|
||||||
|
|
||||||
def check_vers(version, required, text):
|
def check_vers(version, required, text):
|
||||||
if type(version) is str:
|
if type(version) is not str:
|
||||||
version = version.split('.')
|
version = '.'.join(map(str, version))
|
||||||
version = map(int, version)
|
if type(required) is not str:
|
||||||
if type(required) is str:
|
required = '.'.join(map(str, required))
|
||||||
required = required.split('.')
|
w(' %s >= %s ... ' % (text, required))
|
||||||
required = map(int, required)
|
if LooseVersion(version) >= LooseVersion(required):
|
||||||
w(' %s >= %s ... ' % (text, '.'.join(map(str, required))))
|
w(version + os.linesep)
|
||||||
if version >= required:
|
|
||||||
w('.'.join(map(str, version)) + os.linesep)
|
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
w('FAIL' + os.linesep)
|
w('FAIL' + os.linesep)
|
||||||
|
Loading…
Reference in New Issue
Block a user