Skip to content
Snippets Groups Projects
Commit 41cd8f8e authored by Todd Gamblin's avatar Todd Gamblin
Browse files

Fixes #74: minor fixes to spack mirror.

parent 539dea64
Branches
Tags
No related merge requests found
......@@ -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):
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment