do not warn for invalid package name on repo.yaml if subdirectory: '' (#39439)

This commit is contained in:
Greg Becker 2023-08-23 17:23:35 -04:00 committed by GitHub
parent 5ea4322f88
commit 9e5ca525f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -387,7 +387,7 @@ def _create_new_cache(self) -> Dict[str, os.stat_result]:
# Warn about invalid names that look like packages.
if not nm.valid_module_name(pkg_name):
if not pkg_name.startswith("."):
if not pkg_name.startswith(".") and pkg_name != "repo.yaml":
tty.warn(
'Skipping package at {0}. "{1}" is not '
"a valid Spack module name.".format(pkg_dir, pkg_name)