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.
This commit is contained in:
Peter Scheibel 2022-04-01 10:27:03 -07:00 committed by GitHub
parent ea61a657ae
commit a58fa289b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1474,7 +1474,8 @@ def do_fetch(self, mirror_only=False):
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}'))