processRemoval() now adds any updates to be removed to the list before it adds the main item.

git-svn-id: http://munki.googlecode.com/svn/trunk@306 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
Greg Neagle
2009-11-02 23:40:21 +00:00
parent 6524802657
commit b3e8e1e69e
2 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ import FoundationPlist
def get_version():
'''Returns version of munkitools'''
return "0.4.5"
return "0.4.6"
# output and logging functions
+8 -5
View File
@@ -1342,17 +1342,20 @@ def processRemoval(manifestitem, cataloglist, installinfo):
if uninstall_item.get('installs',None):
iteminfo['remove_app_info'] = uninstall_item['installs'][0]
# before we add this removal to the list, check for installed updates and add them to the
# removal list as well:
update_list = lookForUpdates(iteminfo["name"], cataloglist, installinfo)
for update_item in update_list:
# call us recursively...
is_or_will_be_removed = processRemoval(update_item,cataloglist,installinfo)
# finish recording info for this removal
iteminfo["installed"] = True
iteminfo["installed_version"] = uninstall_item.get('version')
if 'RestartAction' in uninstall_item:
iteminfo['RestartAction'] = uninstall_item['RestartAction']
installinfo['removals'].append(iteminfo)
munkicommon.display_detail("Removal of %s added to ManagedInstaller tasks." % manifestitemname_withversion)
# now look to see if there are any updates for this item that should also be removed
update_list = lookForUpdates(iteminfo["name"], cataloglist, installinfo)
for update_item in update_list:
# call us recursively...
is_or_will_be_removed = processRemoval(update_item,cataloglist,installinfo)
return True