diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index f5425d6bbd0..5fdbaa96954 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -306,13 +306,13 @@ def fetch(self): content_types = re.findall(r'Content-Type:[^\r\n]+', headers, flags=re.IGNORECASE) if content_types and 'text/html' in content_types[-1]: - tty.warn("The contents of ", - (self.archive_file if self.archive_file is not None - else "the archive"), - " look like HTML.", - "The checksum will likely be bad. If it is, you can use", - "'spack clean ' to remove the bad archive, then", - "fix your internet gateway issue and install again.") + msg = ("The contents of {0} look like HTML. Either the URL " + "you are trying to use does not exist or you have an " + "internet gateway issue. You can remove the bad archive " + "using 'spack clean ', then try again using " + "the correct URL.") + tty.warn(msg.format(self.archive_file or "the archive")) + if save_file: os.rename(partial_file, save_file)