pro2cmake: Fix regexp for parsing env var expansion

The qmake syntax for env var expansion is "$$()".
The parantheses are not optional, so the optional "?"
modifiers should be removed.
This fixes the failing test_recursive_expansion pytest.

Amends c58df80cf7926b07da9fe6515230bd4295c1fc6d.

Change-Id: I5d7217555287ee7d96d6b38027964b1141af208a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
This commit is contained in:
Alexandru Croitor 2019-09-22 17:54:34 +02:00
parent 5f856a6d0c
commit 303095e686

View File

@ -1098,7 +1098,7 @@ class Scope(object):
if not isinstance(value, str):
return value
pattern = re.compile(r"\$\$\(?([A-Za-z_][A-Za-z0-9_]*)\)?")
pattern = re.compile(r"\$\$\(([A-Za-z_][A-Za-z0-9_]*)\)")
match = re.search(pattern, value)
if match:
value = re.sub(pattern, r"$ENV{\1}", value)