diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py index e768ddf5fe..59d577f0c7 100644 --- a/lib/spack/spack/database.py +++ b/lib/spack/spack/database.py @@ -309,7 +309,11 @@ def reindex(self, directory_layout): for spec in directory_layout.all_specs(): # Create a spec for each known package and add it. path = directory_layout.path_for_spec(spec) - self._add(spec, path, directory_layout) + old_info = old_data.get(spec.dag_hash()) + explicit = False + if old_info is not None: + explicit = old_info.explicit + self._add(spec, path, directory_layout, explicit=explicit) self._check_ref_counts()