From a2a24f664837a8f5c2e9f0c76ac65d52c61ba60b Mon Sep 17 00:00:00 2001 From: Gres Date: Sun, 1 Mar 2020 21:57:45 +0300 Subject: [PATCH] Convert paths --- share/ci/common.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/share/ci/common.py b/share/ci/common.py index 0aee8b3..d6bbb42 100644 --- a/share/ci/common.py +++ b/share/ci/common.py @@ -196,8 +196,6 @@ def apply_cmd_env(cmd): env = sub.run('{} && {}'.format(cmd, env_cmd), shell=True, universal_newlines=True, stdout=sub.PIPE) - is_mingw = 'MINGW_CHOST' in os.environ - lines = env.stdout.split('\n') for line in lines: match = re.match(r"^([a-zA-Z0-9_-]+)=(.*)$", line) @@ -206,10 +204,11 @@ def apply_cmd_env(cmd): key, value = match.groups() if key in os.environ and os.environ[key] == value: continue - if key in os.environ: - print('Changing', key, '\nfrom\n', os.environ[key], '\nto\n', value) - if is_mingw and key.find('PATH') != -1 and value.find('/') != -1: + if key.lower().find('PATH') != -1 and value.find('/') != -1: value = value.replace(':', ';') value = re.sub(r'/(\w)/', r'\1:\\', value) value = value.replace('/', '\\') + if key in os.environ: + print('>>> Changing env', key, '\nfrom\n', + os.environ[key], '\nto\n', value) os.environ[key] = value