mirror of
https://github.com/munki/munki.git
synced 2026-05-08 13:29:29 -05:00
Don't delete package from cache if installation fails. If the package is corrupt, hash/etags should not match the server and it'll redownload. Furthermore, if the install was actually successful regardless of a non-zero installer exit code, the cached package will be downloaded on the next Munki execution after determining that package is no longer needed.
As discussed here: https://groups.google.com/forum/?fromgroups=#!topic/munki-dev/Q5UxFOf6En8
This commit is contained in:
@@ -859,7 +859,9 @@ def installWithInfo(
|
||||
foundagain = True
|
||||
break
|
||||
|
||||
if not foundagain:
|
||||
# ensure package is not deleted from cache if installation
|
||||
# fails by checking retcode
|
||||
if not foundagain and retcode == 0:
|
||||
# now remove the item from the install cache
|
||||
# (if it's still there)
|
||||
itempath = os.path.join(dirpath, current_installer_item)
|
||||
@@ -1224,4 +1226,3 @@ def run(only_unattended=False):
|
||||
errcode = IOPMAssertionRelease(no_idle_sleep_assertion_id)
|
||||
|
||||
return (removals_need_restart or installs_need_restart)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user