summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/checksum.py9
-rw-r--r--lib/spack/spack/cmd/create.py5
-rw-r--r--lib/spack/spack/stage.py3
3 files changed, 12 insertions, 5 deletions
diff --git a/lib/spack/spack/cmd/checksum.py b/lib/spack/spack/cmd/checksum.py
index 86bbd90134..abd161182c 100644
--- a/lib/spack/spack/cmd/checksum.py
+++ b/lib/spack/spack/cmd/checksum.py
@@ -29,6 +29,7 @@ import hashlib
from pprint import pprint
from subprocess import CalledProcessError
+import spack
import spack.cmd
import spack.tty as tty
import spack.packages as packages
@@ -43,6 +44,9 @@ def setup_parser(subparser):
subparser.add_argument(
'package', metavar='PACKAGE', help='Package to list versions for')
subparser.add_argument(
+ '-d', '--dirty', action='store_true', dest='dirty',
+ help="Don't clean up staging area when command completes.")
+ subparser.add_argument(
'versions', nargs=argparse.REMAINDER, help='Versions to generate checksums for')
@@ -67,7 +71,8 @@ def get_checksums(versions, urls, **kwargs):
continue
finally:
- stage.destroy()
+ if not kwargs.get('dirty', False):
+ stage.destroy()
return zip(versions, hashes)
@@ -105,7 +110,7 @@ def checksum(parser, args):
return
version_hashes = get_checksums(
- versions[:archives_to_fetch], urls[:archives_to_fetch])
+ versions[:archives_to_fetch], urls[:archives_to_fetch], dirty=args.dirty)
if not version_hashes:
tty.die("Could not fetch any available versions for %s." % pkg.name)
diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py
index ed454887bf..cf23c4191c 100644
--- a/lib/spack/spack/cmd/create.py
+++ b/lib/spack/spack/cmd/create.py
@@ -83,6 +83,9 @@ class ${class_name}(Package):
def setup_parser(subparser):
subparser.add_argument('url', nargs='?', help="url of package archive")
subparser.add_argument(
+ '-d', '--dirty', action='store_true', dest='dirty',
+ help="Don't clean up staging area when command completes.")
+ subparser.add_argument(
'-f', '--force', action='store_true', dest='force',
help="Overwrite any existing package file with the same name.")
@@ -167,7 +170,7 @@ def create(parser, args):
guesser = ConfigureGuesser()
ver_hash_tuples = spack.cmd.checksum.get_checksums(
versions[:archives_to_fetch], urls[:archives_to_fetch],
- first_stage_function=guesser)
+ first_stage_function=guesser, dirty=args.dirty)
if not ver_hash_tuples:
tty.die("Could not fetch any tarballs for %s." % name)
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index a278950546..a03b58c3a0 100644
--- a/lib/spack/spack/stage.py
+++ b/lib/spack/spack/stage.py
@@ -234,10 +234,9 @@ class Stage(object):
if content_types and 'text/html' in content_types[-1]:
tty.warn("The contents of " + self.archive_file + " look like HTML.",
"The checksum will likely be bad. If it is, you can use",
- "'spack clean --all' to remove the bad archive, then fix",
+ "'spack clean --dist' to remove the bad archive, then fix",
"your internet gateway issue and install again.")
-
def fetch(self):
"""Downloads the file at URL to the stage. Returns true if it was downloaded,
false if it already existed."""