Commit 2e1123f6 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron

* (Core) dependency link version support: policy in [LIMA_]LINK_STRICT_VERSION

parent 189f8825
......@@ -31,9 +31,9 @@ def version_cmp(x, y):
return cmp(version_code(x), version_code(y))
env_var_name = 'LIMA_%s_VERSION' % mod_name.upper()
if env_var_name in os.environ:
version = os.environ[env_var_name]
except KeyError:
version = 'LAST'
req_version = version
......@@ -42,6 +42,7 @@ if version.upper() == 'LAST':
version_dirs = [x for x in os.listdir(root_name) if x.startswith('v')]
version = version_dirs[-1]
del version_dirs, x
if version[0] != 'v':
version = 'v' + version
......@@ -50,11 +51,18 @@ mod_path = os.path.join(root_name, version)
if not (os.path.isdir(mod_path) or os.path.islink(mod_path)):
raise ImportError('Invalid %s: %s' % (env_var_name, req_version))
if os.environ['LIMA_LINK_STRICT_VERSION'] == 'FULL':
core_version_fname = os.path.join(mod_path, 'CORE_VERSION')
core_version_file = open(core_version_fname, 'rt')
core_version = core_version_file.readline().strip()
os.environ['LIMA_CORE_VERSION'] = core_version
del core_version_fname, core_version_file, core_version
from Lima.Mythen.limamythen import Mythen as _P
del root_name, mod_name, mod_path, x, env_var_name
del version, req_version, version_dirs, version_code, version_cmp
del root_name, mod_name, mod_path, env_var_name
del version, req_version, version_code, version_cmp
del os, sys, imp, glob
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment