From f07e01655b8b42d03a67f8a7df9c84a415d822f8 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Tue, 21 Sep 2010 23:30:06 +0000 Subject: [PATCH] Fix for incorrectly initialized KVO arrays in Managed Software Update.app; bumped MSU.app to version 3.0.6; bumped munkitools version to 0.6.0.757.0. git-svn-id: http://munki.googlecode.com/svn/trunk@758 a4e17f2e-e282-11dd-95e1-755cbddbdd66 --- code/Managed Software Update/Info.plist | 4 ++-- code/Managed Software Update/MSUAppDelegate.py | 2 ++ .../MSUOptionalInstallsViewController.py | 3 ++- .../MSUupdatesViewController.py | 4 +++- code/client/munkilib/munkicommon.py | 13 ++++++++++--- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/code/Managed Software Update/Info.plist b/code/Managed Software Update/Info.plist index 87f2a268..fdb590b2 100644 --- a/code/Managed Software Update/Info.plist +++ b/code/Managed Software Update/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 3.0.5 + 3.0.6 CFBundleSignature ???? CFBundleVersion - 3.0.5 + 3.0.6 NSMainNibFile MainMenu NSPrincipalClass diff --git a/code/Managed Software Update/MSUAppDelegate.py b/code/Managed Software Update/MSUAppDelegate.py index 26358be6..29668542 100644 --- a/code/Managed Software Update/MSUAppDelegate.py +++ b/code/Managed Software Update/MSUAppDelegate.py @@ -109,8 +109,10 @@ class MSUAppDelegate(NSObject): self.managedsoftwareupdate_task = None self._listofupdates = [] self.getAvailableUpdates() + #NSLog(u"Building table of available updates.") self.buildUpdateTableData() if self._optionalInstalls: + #NSLog(u"Building table of optional software.") self.buildOptionalInstallsData() self.mainWindowController.theWindow.makeKeyAndOrderFront_(self) if self._listofupdates: diff --git a/code/Managed Software Update/MSUOptionalInstallsViewController.py b/code/Managed Software Update/MSUOptionalInstallsViewController.py index 62baf0fe..7cae9ed2 100644 --- a/code/Managed Software Update/MSUOptionalInstallsViewController.py +++ b/code/Managed Software Update/MSUOptionalInstallsViewController.py @@ -33,7 +33,8 @@ class MSUOptionalInstallsViewController(NSViewController): window_controller = IBOutlet() AddRemoveBtn = IBOutlet() - _optionallist = NSArray.arrayWithArray_([{"installed": NO, "install": NO, "name": "", "version": "", + _optionallist = NSArray.arrayWithArray_([{"installed": NO, "managed": NO, "original_managed": NO, + "name": "", "version": "", "description": "", "size": "", "enabled": NO, "status": "", "original_status": ""}]) diff --git a/code/Managed Software Update/MSUupdatesViewController.py b/code/Managed Software Update/MSUupdatesViewController.py index 1c99a737..bb89299a 100644 --- a/code/Managed Software Update/MSUupdatesViewController.py +++ b/code/Managed Software Update/MSUupdatesViewController.py @@ -35,7 +35,9 @@ class MSUupdatesViewController(NSViewController): window_controller = IBOutlet() updateNowBtn = IBOutlet() - _updatelist = NSArray.arrayWithArray_([{"image": NSImage.imageNamed_("Empty.png"), "name": "", "version": "", "description": ""}]) + _updatelist = NSArray.arrayWithArray_([{"image": NSImage.imageNamed_("Empty.png"), + "name": "", "version": "", "size": "", + "description": ""}]) def updatelist(self): return self._updatelist diff --git a/code/client/munkilib/munkicommon.py b/code/client/munkilib/munkicommon.py index 865ea495..0abf0acd 100644 --- a/code/client/munkilib/munkicommon.py +++ b/code/client/munkilib/munkicommon.py @@ -57,7 +57,7 @@ class InsecureFilePermissionsError(VerifyFilePermissionsError): def get_version(): """Returns version of munkitools""" - return '0.6.0 Build 755' + return '0.6.0 Build 757' # output and logging functions @@ -652,7 +652,7 @@ def getInstallerPkgInfo(filename): bufsize=1, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - (out, err) = proc.communicate() + (out, unused_err) = proc.communicate() if out: restartAction = str(out).rstrip('\n') if restartAction != 'None': @@ -774,6 +774,13 @@ def parsePkgRefs(filename): pkginfo['version'] = \ padVersionString( ref.attributes['version'].value.encode('UTF-8'),5) + payloads = ref.getElementsByTagName('payload') + if payloads: + keys = payloads[0].attributes.keys() + if 'installKBytes' in keys: + pkginfo['installed_size'] = int( + payloads[0].attributes[ + 'installKBytes'].value.encode('UTF-8')) if not pkginfo in info: info.append(pkginfo) return info @@ -1187,7 +1194,7 @@ def verifyFileOnlyWritableByMunkiAndRoot(file_path): raise InsecureFilePermissionsError( 'group does not match munki process!') # verify other users cannot write to the file. - elif file_stat.st_mode & stat.S_IWOTH!= 0: + elif file_stat.st_mode & stat.S_IWOTH != 0: raise InsecureFilePermissionsError('world writable!') except InsecureFilePermissionsError, e: raise InsecureFilePermissionsError(