diff --git a/lib/spack/spack/repo.py b/lib/spack/spack/repo.py index 4e7650b9005..fb78bbe2379 100644 --- a/lib/spack/spack/repo.py +++ b/lib/spack/spack/repo.py @@ -1261,16 +1261,7 @@ def all_package_classes(self) -> Generator[Type["spack.package_base.PackageBase" def exists(self, pkg_name: str) -> bool: """Whether a package with the supplied name exists.""" - if pkg_name is None: - return False - - # if the FastPackageChecker is already constructed, use it - if self._fast_package_checker: - return pkg_name in self._pkg_checker - - # if not, check for the package.py file - path = self.filename_for_package_name(pkg_name) - return os.path.exists(path) + return pkg_name is not None and pkg_name in self._pkg_checker def last_mtime(self): """Time a package file in this repo was last updated."""