diff --git a/lib/spack/spack/repo.py b/lib/spack/spack/repo.py index e4a945f0bfe..11419c2e4e6 100644 --- a/lib/spack/spack/repo.py +++ b/lib/spack/spack/repo.py @@ -599,7 +599,9 @@ def _build_index(self, name: str, indexer: Indexer): """Determine which packages need an update, and update indexes.""" # Filename of the provider index cache (we assume they're all json) - cache_filename = f"{name}/{self.namespace}-index.json" + cache_filename = ( + f"{name}/{self.namespace}-specfile_v{spack.spec.SPECFILE_FORMAT_VERSION}-index.json" + ) # Compute which packages needs to be updated in the cache index_mtime = self.cache.mtime(cache_filename)