summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorscheibelp <scheibel1@llnl.gov>2017-04-27 15:23:09 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2017-04-27 15:23:09 -0700
commit9a67e95686dc3b9ccefa12bafe0ed23cf2f1e235 (patch)
tree9e6d8232c5e998a49abb5d11b72fc2443c4df5af /lib
parente8a814463ccdaaaa12280833de55047c47a20623 (diff)
downloadspack-9a67e95686dc3b9ccefa12bafe0ed23cf2f1e235.tar.gz
spack-9a67e95686dc3b9ccefa12bafe0ed23cf2f1e235.tar.bz2
spack-9a67e95686dc3b9ccefa12bafe0ed23cf2f1e235.tar.xz
spack-9a67e95686dc3b9ccefa12bafe0ed23cf2f1e235.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/database.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py
index 33eb7bea4c..38ea8d584c 100644
--- a/lib/spack/spack/database.py
+++ b/lib/spack/spack/database.py
@@ -473,13 +473,18 @@ class Database(object):
layout = spack.store.layout
if entry.spec.external:
layout = None
- kwargs = {
- 'spec': entry.spec,
- 'directory_layout': layout,
- 'explicit': entry.explicit
- }
- self._add(**kwargs)
- processed_specs.add(entry.spec)
+ install_check = True
+ else:
+ install_check = layout.check_installed(entry.spec)
+
+ if install_check:
+ kwargs = {
+ 'spec': entry.spec,
+ 'directory_layout': layout,
+ 'explicit': entry.explicit
+ }
+ self._add(**kwargs)
+ processed_specs.add(entry.spec)
except Exception as e:
# Something went wrong, so the spec was not restored
# from old data