summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-01-25 02:57:23 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2016-01-25 02:57:23 -0800
commit41cd8f8e6d78f45c31145652a518b9d6d7d9a9c3 (patch)
treeff483ac1c3a08ff1fcc14c6160f87c7dd1b71e49 /lib
parent539dea64118952a3e6a582501e49dc009f7ea3fb (diff)
downloadspack-41cd8f8e6d78f45c31145652a518b9d6d7d9a9c3.tar.gz
spack-41cd8f8e6d78f45c31145652a518b9d6d7d9a9c3.tar.bz2
spack-41cd8f8e6d78f45c31145652a518b9d6d7d9a9c3.tar.xz
spack-41cd8f8e6d78f45c31145652a518b9d6d7d9a9c3.zip
Fixes #74: minor fixes to spack mirror.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/mirror.py4
-rw-r--r--lib/spack/spack/mirror.py7
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/spack/spack/cmd/mirror.py b/lib/spack/spack/cmd/mirror.py
index a71ad16b65..8e9438c1a3 100644
--- a/lib/spack/spack/cmd/mirror.py
+++ b/lib/spack/spack/cmd/mirror.py
@@ -144,15 +144,17 @@ def mirror_list(args):
def _read_specs_from_file(filename):
+ specs = []
with open(filename, "r") as stream:
for i, string in enumerate(stream):
try:
s = Spec(string)
s.package
- args.specs.append(s)
+ specs.append(s)
except SpackError, e:
tty.die("Parse error in %s, line %d:" % (args.file, i+1),
">>> " + string, str(e))
+ return specs
def mirror_create(args):
diff --git a/lib/spack/spack/mirror.py b/lib/spack/spack/mirror.py
index d4f1bb89fe..341cc4cb88 100644
--- a/lib/spack/spack/mirror.py
+++ b/lib/spack/spack/mirror.py
@@ -78,6 +78,7 @@ def get_matching_versions(specs, **kwargs):
continue
num_versions = kwargs.get('num_versions', 0)
+ matching_spec = []
for i, v in enumerate(reversed(sorted(pkg.versions))):
# Generate no more than num_versions versions for each spec.
if num_versions and i >= num_versions:
@@ -88,7 +89,11 @@ def get_matching_versions(specs, **kwargs):
s = Spec(pkg.name)
s.versions = VersionList([v])
s.variants = spec.variants.copy()
- matching.append(s)
+ matching_spec.append(s)
+
+ if not matching_spec:
+ tty.warn("No known version matches spec: %s" % spec)
+ matching.extend(matching_spec)
return matching