From a58fa289b9fb9b593773ace91b531b9547614771 Mon Sep 17 00:00:00 2001 From: Peter Scheibel Date: Fri, 1 Apr 2022 10:27:03 -0700 Subject: 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. --- lib/spack/spack/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') 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}')) -- cgit v1.2.3-60-g2f50