match .spack literal, not as a regex (#26374)
This commit is contained in:
parent
727dcef2f4
commit
1aa7758dbb
@ -6,6 +6,7 @@
|
|||||||
import errno
|
import errno
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
@ -88,8 +89,8 @@ def __init__(self, root, **kwargs):
|
|||||||
self.manifest_file_name = 'install_manifest.json'
|
self.manifest_file_name = 'install_manifest.json'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def hidden_file_paths(self):
|
def hidden_file_regexes(self):
|
||||||
return (self.metadata_dir,)
|
return (re.escape(self.metadata_dir),)
|
||||||
|
|
||||||
def relative_path_for_spec(self, spec):
|
def relative_path_for_spec(self, spec):
|
||||||
_check_concrete(spec)
|
_check_concrete(spec)
|
||||||
|
@ -406,7 +406,7 @@ def merge(self, spec, ignore=None):
|
|||||||
|
|
||||||
ignore = ignore or (lambda f: False)
|
ignore = ignore or (lambda f: False)
|
||||||
ignore_file = match_predicate(
|
ignore_file = match_predicate(
|
||||||
self.layout.hidden_file_paths, ignore)
|
self.layout.hidden_file_regexes, ignore)
|
||||||
|
|
||||||
# check for dir conflicts
|
# check for dir conflicts
|
||||||
conflicts = tree.find_dir_conflicts(view_dst, ignore_file)
|
conflicts = tree.find_dir_conflicts(view_dst, ignore_file)
|
||||||
@ -432,7 +432,7 @@ def unmerge(self, spec, ignore=None):
|
|||||||
|
|
||||||
ignore = ignore or (lambda f: False)
|
ignore = ignore or (lambda f: False)
|
||||||
ignore_file = match_predicate(
|
ignore_file = match_predicate(
|
||||||
self.layout.hidden_file_paths, ignore)
|
self.layout.hidden_file_regexes, ignore)
|
||||||
|
|
||||||
merge_map = tree.get_file_map(view_dst, ignore_file)
|
merge_map = tree.get_file_map(view_dst, ignore_file)
|
||||||
pkg.remove_files_from_view(self, merge_map)
|
pkg.remove_files_from_view(self, merge_map)
|
||||||
|
@ -1952,7 +1952,7 @@ def check_paths(path_list, filetype, predicate):
|
|||||||
|
|
||||||
installed = set(os.listdir(self.prefix))
|
installed = set(os.listdir(self.prefix))
|
||||||
installed.difference_update(
|
installed.difference_update(
|
||||||
spack.store.layout.hidden_file_paths)
|
spack.store.layout.hidden_file_regexes)
|
||||||
if not installed:
|
if not installed:
|
||||||
raise InstallError(
|
raise InstallError(
|
||||||
"Install failed for %s. Nothing was installed!" % self.name)
|
"Install failed for %s. Nothing was installed!" % self.name)
|
||||||
|
Loading…
Reference in New Issue
Block a user