summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>2011-06-23 04:26:42 +0000
committerlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>2011-06-23 04:26:42 +0000
commitd59e5cdc9c0e10f5fc2ff24f03d3a22b9759de58 (patch)
tree4ea00e5725b93610cf569531cd1246775103e071
parent52112aa0e3c77c87cb020ce8ab68201eec210711 (diff)
utils.external_packages: Introduce minimum_version
Some python modules, such as setup tools, might have a minimum version under which the needed functionality for autotest is OK. In case of setup tools, any version equal or higher than 0.6 is OK, but in case the module is completely missing, we'll install 0.6c11, which is the latest upstream. So, make possible to specify 'minimum versions' for packages, if we have that one, make the is_needed check with that version. Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com> git-svn-id: svn://test.kernel.org/autotest/trunk@5445 592f7852-d20e-0410-864c-8624ca9c26a4
-rw-r--r--utils/external_packages.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/external_packages.py b/utils/external_packages.py
index 72403671..5755105b 100644
--- a/utils/external_packages.py
+++ b/utils/external_packages.py
@@ -109,7 +109,10 @@ class ExternalPackage(object):
self.installed_version = self._get_installed_version_from_module(module)
logging.info('imported %s version %s.', self.module_name,
self.installed_version)
- return self.version > self.installed_version
+ if hasattr(self, 'minimum_version'):
+ return self.minimum_version > self.installed_version
+ else:
+ return self.version > self.installed_version
def _get_installed_version_from_module(self, module):
@@ -476,6 +479,9 @@ class SetuptoolsPackage(ExternalPackage):
# For all known setuptools releases a string compare works for the
# version string. Hopefully they never release a 0.10. (Their own
# version comparison code would break if they did.)
+ # Any system with setuptools > 0.6 is fine. If none installed, then
+ # try to install the latest found on the upstream.
+ minimum_version = '0.6'
version = '0.6c11'
urls = ('http://pypi.python.org/packages/source/s/setuptools/'
'setuptools-%s.tar.gz' % (version,),)