Revert "Repo.packages_with_tags: do not construct a set of all packages (#49141)" (#49172)

This reverts commit 0da5bafaf2.
This commit is contained in:
Harmen Stoppels 2025-02-24 16:46:41 +01:00 committed by GitHub
parent 29e3a28071
commit e783a2851d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1179,9 +1179,8 @@ def all_package_paths(self) -> Generator[str, None, None]:
yield self.package_path(name)
def packages_with_tags(self, *tags: str) -> Set[str]:
v = set(self.tag_index[tags[0].lower()])
for tag in tags[1:]:
v.intersection_update(self.tag_index[tag.lower()])
v = set(self.all_package_names())
v.intersection_update(*(self.tag_index[tag.lower()] for tag in tags))
return v
def all_package_classes(self) -> Generator[Type["spack.package_base.PackageBase"], None, None]: