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 <[email protected]> --- utils/external_packages.py | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/utils/external_packages.py b/utils/external_packages.py index 06fd05c..863989f 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,),) -- 1.7.5.4 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
