diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2020-07-08 02:38:42 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-08 09:38:42 +0200 |
commit | 207e496162f9bcef5f88ecdede3224cd9b588858 (patch) | |
tree | 7533741dca7cbf1aa912cfa13e2b0e1bad22a0d8 /lib | |
parent | f0391db096552c7dd3750b0e244d5b3930fb480d (diff) | |
download | spack-207e496162f9bcef5f88ecdede3224cd9b588858.tar.gz spack-207e496162f9bcef5f88ecdede3224cd9b588858.tar.bz2 spack-207e496162f9bcef5f88ecdede3224cd9b588858.tar.xz spack-207e496162f9bcef5f88ecdede3224cd9b588858.zip |
spack create: ask how many to download (#17373)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/cmd/checksum.py | 2 | ||||
-rw-r--r-- | lib/spack/spack/cmd/create.py | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/spack/spack/cmd/checksum.py b/lib/spack/spack/cmd/checksum.py index 97e7833af0..188deb1149 100644 --- a/lib/spack/spack/cmd/checksum.py +++ b/lib/spack/spack/cmd/checksum.py @@ -65,7 +65,7 @@ def checksum(parser, args): version_lines = spack.stage.get_checksums_for_versions( url_dict, pkg.name, keep_stage=args.keep_stage, - batch=(args.batch or len(args.versions) > 0), + batch=(args.batch or len(args.versions) > 0 or len(url_dict) == 1), fetch_options=pkg.fetch_options) print() diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py index 7d12dc98a7..48326868ae 100644 --- a/lib/spack/spack/cmd/create.py +++ b/lib/spack/spack/cmd/create.py @@ -445,6 +445,9 @@ def setup_parser(subparser): subparser.add_argument( '--skip-editor', action='store_true', help="skip the edit session for the package (e.g., automation)") + subparser.add_argument( + '-b', '--batch', action='store_true', + help="don't ask which versions to checksum") class BuildSystemGuesser: @@ -511,7 +514,7 @@ class BuildSystemGuesser: # Determine the build system based on the files contained # in the archive. for pattern, bs in clues: - if any(re.search(pattern, l) for l in lines): + if any(re.search(pattern, line) for line in lines): self.build_system = bs break @@ -629,7 +632,8 @@ def get_versions(args, name): versions = spack.stage.get_checksums_for_versions( url_dict, name, first_stage_function=guesser, - keep_stage=args.keep_stage, batch=True) + keep_stage=args.keep_stage, + batch=(args.batch or len(url_dict) == 1)) else: versions = unhashed_versions |