summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/repo.py10
-rw-r--r--lib/spack/spack/test/repo.py6
2 files changed, 11 insertions, 5 deletions
diff --git a/lib/spack/spack/repo.py b/lib/spack/spack/repo.py
index f9f733ef7f..6e4c0a2f49 100644
--- a/lib/spack/spack/repo.py
+++ b/lib/spack/spack/repo.py
@@ -150,11 +150,11 @@ class FastPackageChecker(Mapping):
pkg_dir = os.path.join(self.packages_path, pkg_name)
# Warn about invalid names that look like packages.
- if (not valid_module_name(pkg_name)
- and not pkg_name.startswith('.')):
- msg = 'Skipping package at {0}. '
- msg += '"{1}" is not a valid Spack module name.'
- tty.warn(msg.format(pkg_dir, pkg_name))
+ if not valid_module_name(pkg_name):
+ if not pkg_name.startswith('.'):
+ tty.warn('Skipping package at {0}. "{1}" is not '
+ 'a valid Spack module name.'.format(
+ pkg_dir, pkg_name))
continue
# Construct the file name from the directory
diff --git a/lib/spack/spack/test/repo.py b/lib/spack/spack/test/repo.py
index 8f37bc6754..e171dbca68 100644
--- a/lib/spack/spack/test/repo.py
+++ b/lib/spack/spack/test/repo.py
@@ -64,3 +64,9 @@ def test_repo_last_mtime():
latest_mtime = max(os.path.getmtime(p.module.__file__)
for p in spack.repo.path.all_packages())
assert spack.repo.path.last_mtime() == latest_mtime
+
+
+def test_repo_invisibles(repo_for_test, extra_repo):
+ with open(os.path.join(extra_repo.root, 'packages', '.invisible'), 'w'):
+ pass
+ extra_repo.all_package_names()