Add receipts to the list of key values to hash if an item's uninstall_method is 'removepackages'. We need a complete list of receipt IDs that may have been installed in order to do a good job of uninstalling. This largely affects Office2011_updates, which have unique pkgids for each update. Sigh.

This commit is contained in:
Greg Neagle
2016-12-12 10:27:03 -08:00
parent 5ae397eee4
commit b4dbbe27a4
+9 -3
View File
@@ -334,13 +334,19 @@ def clean_repo(repopath, options):
manifest_items.add(name)
metakey = ''
for key in ['name', 'catalogs', 'minimum_munki_version',
'minimum_os_version', 'maximum_os_version',
'supported_architectures', 'installable_condition']:
keys_to_hash = ['name', 'catalogs', 'minimum_munki_version',
'minimum_os_version', 'maximum_os_version',
'supported_architectures', 'installable_condition']
if pkginfo.get('uninstall_method') == 'removepackages':
keys_to_hash.append('receipts')
for key in keys_to_hash:
if pkginfo.get(key):
value = pkginfo[key]
if key == 'catalogs':
value = ', '.join(value)
if key == 'receipts':
value = ', '.join(
[item.get('packageid', '') for item in value])
metakey += u"%s: %s\n" % (key, value)
metakey = metakey.rstrip('\n')
if metakey not in pkginfodb: