filter __spack_path_placeholder__ in generated module files after buildcache install (#36611)
* filter __spack_path_placeholder__ in generated module files after buildcache install * fix windows
This commit is contained in:
parent
5560017ebe
commit
e9a1d0a157
@ -703,7 +703,7 @@ def configure_options(self):
|
|||||||
|
|
||||||
if os.path.exists(pkg.install_configure_args_path):
|
if os.path.exists(pkg.install_configure_args_path):
|
||||||
with open(pkg.install_configure_args_path, "r") as args_file:
|
with open(pkg.install_configure_args_path, "r") as args_file:
|
||||||
return args_file.read()
|
return spack.util.path.padding_filter(args_file.read())
|
||||||
|
|
||||||
# Returning a false-like value makes the default templates skip
|
# Returning a false-like value makes the default templates skip
|
||||||
# the configure option section
|
# the configure option section
|
||||||
|
@ -444,7 +444,7 @@ def padding_filter(string):
|
|||||||
r"(/{pad})+" # the padding string repeated one or more times
|
r"(/{pad})+" # the padding string repeated one or more times
|
||||||
r"(/{longest_prefix})?(?=/)" # trailing prefix of padding as path component
|
r"(/{longest_prefix})?(?=/)" # trailing prefix of padding as path component
|
||||||
)
|
)
|
||||||
regex = regex.replace("/", os.sep)
|
regex = regex.replace("/", re.escape(os.sep))
|
||||||
regex = regex.format(pad=pad, longest_prefix=longest_prefix)
|
regex = regex.format(pad=pad, longest_prefix=longest_prefix)
|
||||||
_filter_re = re.compile(regex)
|
_filter_re = re.compile(regex)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user