Skip to content
Snippets Groups Projects
Commit ebc507dc authored by Todd Gamblin's avatar Todd Gamblin
Browse files

Clean up half-downloaded tarballs.

parent 7a67cc16
No related branches found
No related tags found
No related merge requests found
...@@ -155,11 +155,17 @@ def fetch(self): ...@@ -155,11 +155,17 @@ def fetch(self):
else: else:
tty.msg("Fetching %s" % self.url) tty.msg("Fetching %s" % self.url)
# Run curl but grab the mime type from the http headers try:
headers = spack.curl('-#', # status bar # Run curl but grab the mime type from the http headers
'-O', # save file to disk headers = spack.curl('-#', # status bar
'-D', '-', # print out HTML headers '-O', # save file to disk
'-L', self.url, return_output=True) '-D', '-', # print out HTML headers
'-L', self.url, return_output=True)
except:
# clean up archive on failure.
if self.archive_file:
os.remove(self.archive_file)
raise
# Check if we somehow got an HTML file rather than the archive we # Check if we somehow got an HTML file rather than the archive we
# asked for. We only look at the last content type, to handle # asked for. We only look at the last content type, to handle
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment