Reindex checks install for non-external packages (#4027)
Fixes #4026 #1167 updated Database.reindex to keep old installation records to support external packages. However, when a user manually removes a prefix and reindexes this kept the records so the packages were still installed according to "spack find" etc. This adds a check for non-external packages to ensure they are properly installed according to the directory layout.
This commit is contained in:
parent
e8a814463c
commit
9a67e95686
@ -473,13 +473,18 @@ def _read_suppress_error():
|
|||||||
layout = spack.store.layout
|
layout = spack.store.layout
|
||||||
if entry.spec.external:
|
if entry.spec.external:
|
||||||
layout = None
|
layout = None
|
||||||
kwargs = {
|
install_check = True
|
||||||
'spec': entry.spec,
|
else:
|
||||||
'directory_layout': layout,
|
install_check = layout.check_installed(entry.spec)
|
||||||
'explicit': entry.explicit
|
|
||||||
}
|
if install_check:
|
||||||
self._add(**kwargs)
|
kwargs = {
|
||||||
processed_specs.add(entry.spec)
|
'spec': entry.spec,
|
||||||
|
'directory_layout': layout,
|
||||||
|
'explicit': entry.explicit
|
||||||
|
}
|
||||||
|
self._add(**kwargs)
|
||||||
|
processed_specs.add(entry.spec)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# Something went wrong, so the spec was not restored
|
# Something went wrong, so the spec was not restored
|
||||||
# from old data
|
# from old data
|
||||||
|
Loading…
Reference in New Issue
Block a user