summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-03-08 10:39:46 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2016-03-08 10:39:46 -0800
commita4861a30729e32aef493b3418d03874837eecc08 (patch)
treee03d740ea659d189cda485b28c93785080f916d5 /lib
parent747855b960d129dde097bda5f6e34e346fd9764f (diff)
downloadspack-a4861a30729e32aef493b3418d03874837eecc08.tar.gz
spack-a4861a30729e32aef493b3418d03874837eecc08.tar.bz2
spack-a4861a30729e32aef493b3418d03874837eecc08.tar.xz
spack-a4861a30729e32aef493b3418d03874837eecc08.zip
Minor changes/bugfixes on md5/checksum PR
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/checksum.py5
-rw-r--r--lib/spack/spack/cmd/md5.py4
-rw-r--r--lib/spack/spack/cmd/stage.py4
-rw-r--r--lib/spack/spack/stage.py2
4 files changed, 6 insertions, 9 deletions
diff --git a/lib/spack/spack/cmd/checksum.py b/lib/spack/spack/cmd/checksum.py
index 5504673c9e..518d2703dc 100644
--- a/lib/spack/spack/cmd/checksum.py
+++ b/lib/spack/spack/cmd/checksum.py
@@ -56,8 +56,7 @@ def get_checksums(versions, urls, **kwargs):
i = 0
for url, version in zip(urls, versions):
try:
- with Stage(url) as stage:
- stage.delete_on_exit = not keep_stage
+ with Stage(url, keep=keep_stage) as stage:
stage.fetch()
if i == 0 and first_stage_function:
first_stage_function(stage)
@@ -96,7 +95,7 @@ def checksum(parser, args):
tty.msg("Found %s versions of %s" % (len(versions), pkg.name),
*spack.cmd.elide_list(
["%-10s%s" % (v, versions[v]) for v in sorted_versions]))
- print()
+ print
archives_to_fetch = tty.get_number(
"How many would you like to checksum?", default=5, abort='q')
diff --git a/lib/spack/spack/cmd/md5.py b/lib/spack/spack/cmd/md5.py
index 20508abf99..f99fc0f8c2 100644
--- a/lib/spack/spack/cmd/md5.py
+++ b/lib/spack/spack/cmd/md5.py
@@ -67,6 +67,6 @@ def md5(parser, args):
tty.warn("%s" % e)
# Dump the MD5s at last without interleaving them with downloads
- tty.msg("Number of MD5 check-sums computed: %s " % len(results))
+ tty.msg("%d MD5 checksums:" % len(results))
for checksum, url in results:
- tty.msg("%s %s" % (checksum, url))
+ print "%s %s" % (checksum, url)
diff --git a/lib/spack/spack/cmd/stage.py b/lib/spack/spack/cmd/stage.py
index b575f6c456..5786780efb 100644
--- a/lib/spack/spack/cmd/stage.py
+++ b/lib/spack/spack/cmd/stage.py
@@ -50,6 +50,4 @@ def stage(parser, args):
specs = spack.cmd.parse_specs(args.specs, concretize=True)
for spec in specs:
package = spack.repo.get(spec)
- with package.stage as stage:
- stage.delete_on_exit = False
- package.do_stage()
+ package.do_stage()
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index 0d35511c34..d2ed03c271 100644
--- a/lib/spack/spack/stage.py
+++ b/lib/spack/spack/stage.py
@@ -441,7 +441,7 @@ class StageComposite:
def __exit__(self, exc_type, exc_val, exc_tb):
for item in reversed(self):
- item.delete_on_exit = getattr(self, 'delete_on_exit', True)
+ item.keep = getattr(self, 'keep', None)
item.__exit__(exc_type, exc_val, exc_tb)
#