If a cached manifest is corrupt, delete it.

This commit is contained in:
Justin McWilliams
2011-12-22 11:27:15 -05:00
parent c916885e03
commit 6e9790c129
+10 -4
View File
@@ -2058,13 +2058,19 @@ def processRemoval(manifestitem, cataloglist, installinfo):
def getManifestData(manifestpath):
'''Reads a manifest file, returns a
dictionary-like object'''
'''Reads a manifest file, returns a dictionary-like object.'''
plist = {}
try:
plist = FoundationPlist.readPlist(manifestpath)
except FoundationPlist.NSPropertyListSerializationException:
munkicommon.display_error('Could not read plist %s' % manifestpath)
munkicommon.display_error('Could not read plist: %s', manifestpath)
if os.path.exists(manifestpath):
try:
os.unlink(manifestpath)
except OSError, e:
munkicommon.display_error('Failed to delete plist: %s', str(e))
else:
munkicommon.display_error('plist does not exist.')
return plist
@@ -2464,7 +2470,7 @@ def curl(url, destinationpath, onlyifnewer=False, etag=None, resume=False,
# Prefer Content-Length header to determine download size,
# otherwise fall back to a custom X-Download-Size header.
# This is primary for servers that use chunked transfer
# encoding, when Content-Length is forbidden by
# encoding, when Content-Length is forbidden by
# RFC2616 4.4. An example of such a server is
# Google App Engine Blobstore.
targetsize = (