mirror of
https://github.com/munki/munki.git
synced 2026-03-15 05:50:16 -05:00
1) fix OSError because nonexistent file is attempted to be read if HTTP status=200 but response yields no download; this happens if local Cache package is *newer* than package on the server (curl receives 200 but doesn't download); instead raise HTTPError. 2) In the event of a curl() download error, delete any existing cache files related to the failed download (destination or tmp names). This is basically just resetting state after any download failures that aren't resume related, one of those failures being the temp download file doesn't exist. This fixes a problem where if the destination exists and the date (header: If-Modified-Since) is newer than on the server (header: Last-Modified), the curl binary does not ever download the older file. In this case Munki never has a .download temp file, so it can't overwrite the original/newer file. A susequent Munki execution will download the older server file. git-svn-id: http://munki.googlecode.com/svn/trunk@783 a4e17f2e-e282-11dd-95e1-755cbddbdd66