Fix looping issue when updating an existing optional install. Fixes issue 282

This commit is contained in:
Greg Neagle
2014-03-04 08:41:09 -08:00
parent 64593614de
commit 3cc570fea1
3 changed files with 9 additions and 3 deletions
@@ -670,7 +670,7 @@ class MSUMainWindowController(NSWindowController):
# do we need to add a new node to the other list?
if item.get('needs_update'):
# make some new HTML for the updated item
managed_update_names = munki.getInstallInfo().get('managed_updates', [])
managed_update_names = MunkiItems.getInstallInfo().get('managed_updates', [])
item_template = msulib.get_template('update_row_template.html')
item_html = item_template.safe_substitute(item)
@@ -167,9 +167,12 @@ def getEffectiveUpdateList():
def allOptionalChoicesProcessed():
# get processed optional installs and removals
install_info = getInstallInfo()
managed_installs_names = [item['name']
for item in install_info.get('managed_installs', [])]
processed_optional_items = install_info.get('optional_installs')
processed_install_names = [item['name'] for item in processed_optional_items
if item.get('will_be_installed')]
if item.get('will_be_installed')
or item['name'] in managed_installs_names]
#NSLog('processed_install_names: %s' % processed_install_names)
processed_removal_names = [item['name'] for item in processed_optional_items
if item.get('will_be_removed')]
@@ -464,6 +467,9 @@ class GenericItem(dict):
'removing':
NSLocalizedString(u'Removing',
u'RemovingLongActionText').encode('utf-8'),
'update-available':
NSLocalizedString(u'Update',
u'UpdateLongActionText').encode('utf-8'),
'update-will-be-installed':
NSLocalizedString(u'Remove',
u'RemoveLongActionText').encode('utf-8'),
@@ -125,7 +125,7 @@ def convertIconToPNG(app_name, destination_path, desired_size):
closest to (but >= than if possible) the desired_size. Returns True if
successful, False otherwise'''
app_path = os.path.join('/Applications', app_name + '.app')
if not os .path.exists(app_path):
if not os.path.exists(app_path):
return False
try:
info = FoundationPlist.readPlist(os.path.join(app_path, 'Contents/Info.plist'))