diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/database.py | 19 |
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 |