summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPeter Scheibel <scheibel1@llnl.gov>2022-04-01 10:27:03 -0700
committerGitHub <noreply@github.com>2022-04-01 10:27:03 -0700
commita58fa289b9fb9b593773ace91b531b9547614771 (patch)
tree30775154ffc1de0bfefe0c346b3600ecd894fdf6 /lib
parentea61a657ae4f0b9739acef7a55fbfdaead33864c (diff)
downloadspack-a58fa289b9fb9b593773ace91b531b9547614771.tar.gz
spack-a58fa289b9fb9b593773ace91b531b9547614771.tar.bz2
spack-a58fa289b9fb9b593773ace91b531b9547614771.tar.xz
spack-a58fa289b9fb9b593773ace91b531b9547614771.zip
Allow "spack install foo@git-hash" without terminal prompt (#29827)
Do not prompt user with checksum warning when using git commit hashes as versions. Spack was incorrectly reporting this as a potential problem: it would display a prompt asking the user whether they want to proceed if Spack was running in a terminal, or it would terminate the running instance of Spack if running as part of a script.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/package.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index edd00caae6..532a9ff318 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -1474,7 +1474,8 @@ class PackageBase(six.with_metaclass(PackageMeta, PackageViewMixin, object)):
checksum = spack.config.get('config:checksum')
fetch = self.stage.managed_by_spack
- if checksum and fetch and self.version not in self.versions:
+ if checksum and fetch and (self.version not in self.versions) \
+ and (not self.version.is_commit):
tty.warn("There is no checksum on file to fetch %s safely." %
self.spec.cformat('{name}{@version}'))