From 3bc78d53a269f6192131a2d6bba2d5763c0b7890 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Fri, 21 Feb 2014 08:35:11 -0800 Subject: [PATCH 01/10] Make sure the need to restart is not lost when Munki updates need a restart but Apple updates do not. --- code/client/managedsoftwareupdate | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/code/client/managedsoftwareupdate b/code/client/managedsoftwareupdate index 4d151b12..8a6d55f5 100755 --- a/code/client/managedsoftwareupdate +++ b/code/client/managedsoftwareupdate @@ -212,12 +212,13 @@ def doInstallTasks(do_apple_updates, only_unattended=False): # of installs clearLastNotifiedDate() - need_to_restart = False + munki_need_to_restart = False + apple_need_to_restart = False if munkiUpdatesAvailable(): # install munki updates try: - need_to_restart = installer.run(only_unattended=only_unattended) + munki_need_to_restart = installer.run(only_unattended=only_unattended) except: munkicommon.display_error('Unexpected error in munkilib.installer:') munkicommon.log(traceback.format_exc()) @@ -227,7 +228,7 @@ def doInstallTasks(do_apple_updates, only_unattended=False): if do_apple_updates: # install Apple updates try: - need_to_restart = appleupdates.installAppleUpdates( + apple_need_to_restart = appleupdates.installAppleUpdates( only_unattended=only_unattended) except: munkicommon.display_error( @@ -237,7 +238,7 @@ def doInstallTasks(do_apple_updates, only_unattended=False): raise munkicommon.savereport() - return need_to_restart + return munki_need_to_restart or apple_need_to_restart def startLogoutHelper(): @@ -774,7 +775,8 @@ def main(): munkicommon.log('Installing only items marked unattended ' 'because SuppressLoginwindowInstall is ' 'true.') - doInstallTasks(appleupdatesavailable, only_unattended=True) + ignore_restart = doInstallTasks( + appleupdatesavailable, only_unattended=True) elif getIdleSeconds() < 10: munkicommon.log('Skipping auto install at loginwindow ' 'because system is not idle ' @@ -800,7 +802,8 @@ def main(): # don't require a logout unused_action = updatecheck.checkForceInstallPackages() # install anything that can be done unattended - doInstallTasks(appleupdatesavailable, only_unattended=True) + ignore_restart = doInstallTasks( + appleupdatesavailable, only_unattended=True) # send a notification event so MSU can update its display # if needed From e45a64cc53ba46ce7de631ab1ce81e34b9943b02 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Thu, 27 Feb 2014 13:55:54 -0800 Subject: [PATCH 02/10] Fix typo for 'Mandatory Updates Pending' alert --- .../Dutch.lproj/Localizable.strings | 2 +- .../French.lproj/Localizable.strings | 2 +- .../German.lproj/Localizable.strings | 2 +- .../Managed Software Update/MSUAppDelegate.py | 2 +- .../Spanish.lproj/Localizable.strings | 2 +- .../da.lproj/Localizable.strings | 2 +- .../fi.lproj/Localizable.strings | 2 +- .../nb.lproj/Localizable.strings | 2 +- .../ru.lproj/Localizable.strings | 2 +- .../sv.lproj/Localizable.strings | Bin 13688 -> 13686 bytes 10 files changed, 9 insertions(+), 9 deletions(-) diff --git a/code/Managed Software Update/Dutch.lproj/Localizable.strings b/code/Managed Software Update/Dutch.lproj/Localizable.strings index af8c15ee..3ad01b3a 100644 --- a/code/Managed Software Update/Dutch.lproj/Localizable.strings +++ b/code/Managed Software Update/Dutch.lproj/Localizable.strings @@ -21,7 +21,7 @@ "Logout Recommended" = "Uitloggen Aanbevolen"; "Logout Required" = "Uitloggen Benodigd"; "Logout will be required." = "Uitloggen zal benodigd zijn."; -"Manadatory Updates Pending" = "Verplichte Updates Aanhangig"; +"Mandatory Updates Pending" = "Verplichte Updates Aanhangig"; "Managed Software Update cannot contact the update server at this time.\nIf this situation continues, contact your systems administrator." = "Beheerde Softwarebijwerking kan geen kontakt maken met de server.\nNeem kontakt op met Uw systeembeheerder als deze fout zich nogmaals voordoet."; "Managed Software Update failed its preflight check.\nTry again later." = "Beheerde Softwarebijwerking had een fout tijdens de voorbereidingsfase.\nProbeer het later nogmaals."; "Not installed" = "Niet geïnstalleerd"; diff --git a/code/Managed Software Update/French.lproj/Localizable.strings b/code/Managed Software Update/French.lproj/Localizable.strings index d3c8bc9d..7b6550d3 100644 --- a/code/Managed Software Update/French.lproj/Localizable.strings +++ b/code/Managed Software Update/French.lproj/Localizable.strings @@ -80,7 +80,7 @@ "Logout will be required." = "La fermeture de session sera obligatoire"; /* No comment provided by engineer. */ -"Manadatory Updates Pending" = "Mises à jour obligatoires en attente"; +"Mandatory Updates Pending" = "Mises à jour obligatoires en attente"; /* No comment provided by engineer. */ "Managed Software Update cannot contact the update server at this time.\nIf this situation continues, contact your systems administrator." = "Mise à jour de logiciels ne peut atteindre le serveur de mise à jour pour l'instant.\nSi la situation persiste, contactez votre administrateur système."; diff --git a/code/Managed Software Update/German.lproj/Localizable.strings b/code/Managed Software Update/German.lproj/Localizable.strings index a5505544..318fdeb8 100644 --- a/code/Managed Software Update/German.lproj/Localizable.strings +++ b/code/Managed Software Update/German.lproj/Localizable.strings @@ -72,7 +72,7 @@ "Logout will be required." = "Abmelden ist erforderlich."; /* No comment provided by engineer. */ -"Manadatory Updates Pending" = "Zwingend notwendige Aktualisierungen anstehend"; +"Mandatory Updates Pending" = "Zwingend notwendige Aktualisierungen anstehend"; /* No comment provided by engineer. */ "Managed Software Update cannot contact the update server at this time.\nIf this situation continues, contact your systems administrator." = "Geführte Softwareaktualisierung erreicht den Server nicht.\nWenn dieses Problem weiter besteht, informieren Sie bitte Ihren Administrator."; diff --git a/code/Managed Software Update/MSUAppDelegate.py b/code/Managed Software Update/MSUAppDelegate.py index aab763b3..a0d8ec1f 100644 --- a/code/Managed Software Update/MSUAppDelegate.py +++ b/code/Managed Software Update/MSUAppDelegate.py @@ -643,7 +643,7 @@ class MSUAppDelegate(NSObject): (u"One or more mandatory updates are overdue for " "installation. A logout will be forced soon."), None) alert = NSAlert.alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat_( - NSLocalizedString(u"Manadatory Updates Pending", None), + NSLocalizedString(u"Mandatory Updates Pending", None), NSLocalizedString(u"Show updates", None), NSLocalizedString(u"Update later", None), objc.nil, diff --git a/code/Managed Software Update/Spanish.lproj/Localizable.strings b/code/Managed Software Update/Spanish.lproj/Localizable.strings index d61fbece..5a8ace5f 100644 --- a/code/Managed Software Update/Spanish.lproj/Localizable.strings +++ b/code/Managed Software Update/Spanish.lproj/Localizable.strings @@ -74,7 +74,7 @@ "Logout will be required." = "Será necesario cerrar sesión"; /* No comment provided by engineer. */ -"Manadatory Updates Pending" = "Actualizaciones obligatorias pendientes"; +"Mandatory Updates Pending" = "Actualizaciones obligatorias pendientes"; /* No comment provided by engineer. */ "Managed Software Update cannot contact the update server at this time.\nIf this situation continues, contact your systems administrator." = "Actualización controlada de software no ha podido contactar con el servidor.\nSi este problema continua, contacte con su administrador."; diff --git a/code/Managed Software Update/da.lproj/Localizable.strings b/code/Managed Software Update/da.lproj/Localizable.strings index 2d5a6782..2823432f 100644 --- a/code/Managed Software Update/da.lproj/Localizable.strings +++ b/code/Managed Software Update/da.lproj/Localizable.strings @@ -43,7 +43,7 @@ "Logout will be required." = "Kræver log ud."; -"Manadatory Updates Pending" = "Obligatoriske opdateringer venter"; +"Mandatory Updates Pending" = "Obligatoriske opdateringer venter"; "Managed Software Update cannot contact the update server at this time.\nIf this situation continues, contact your systems administrator." = "Managed Software Update kan ikke få forbindelse til opdateringsserveren.\nHvis problemet består, skal du kontakte systemadministratoren."; diff --git a/code/Managed Software Update/fi.lproj/Localizable.strings b/code/Managed Software Update/fi.lproj/Localizable.strings index d8197cf2..3dd87cf2 100644 --- a/code/Managed Software Update/fi.lproj/Localizable.strings +++ b/code/Managed Software Update/fi.lproj/Localizable.strings @@ -74,7 +74,7 @@ "Logout will be required." = "Uloskirjautumista tullaan vaatimaan."; /* No comment provided by engineer. */ -"Manadatory Updates Pending" = "Pakollisia päivityksiä odottamassa"; +"Mandatory Updates Pending" = "Pakollisia päivityksiä odottamassa"; /* No comment provided by engineer. */ "Managed Software Update cannot contact the update server at this time.\nIf this situation continues, contact your systems administrator." = "Päivityspalvelimeen ei saada yhteyttä.\nJos ongelma jatkuu, ota yhteyttä järjestelmän ylläpitäjään."; diff --git a/code/Managed Software Update/nb.lproj/Localizable.strings b/code/Managed Software Update/nb.lproj/Localizable.strings index b442553e..60121a0d 100644 --- a/code/Managed Software Update/nb.lproj/Localizable.strings +++ b/code/Managed Software Update/nb.lproj/Localizable.strings @@ -49,7 +49,7 @@ "Logout will be required." = "Krever utlogging."; -"Manadatory Updates Pending" = "Obligatoriske oppdateringer venter"; +"Mandatory Updates Pending" = "Obligatoriske oppdateringer venter"; "Managed Software Update cannot contact the update server at this time.\nIf this situation continues, contact your systems administrator." = "Managed Software Update klarer ikke å oppnå forbindelse til oppdateringsserveren.\nHvis problemet fortsetter, ta kontakt systemadministrator."; diff --git a/code/Managed Software Update/ru.lproj/Localizable.strings b/code/Managed Software Update/ru.lproj/Localizable.strings index a68bd939..f3173877 100644 --- a/code/Managed Software Update/ru.lproj/Localizable.strings +++ b/code/Managed Software Update/ru.lproj/Localizable.strings @@ -24,7 +24,7 @@ "Logout Recommended" = "Рекомендуется выйти из системы"; "Logout Required" = "Необходимо выйти из системы"; "Logout will be required." = "Потребуется выйти из системы."; -"Manadatory Updates Pending" = "Отложенные обязательные обновления"; +"Mandatory Updates Pending" = "Отложенные обязательные обновления"; "Managed Software Update cannot contact the update server at this time.\nIf this situation continues, contact your systems administrator." = "В данный момент сервер обновлений не доступен.\nОбратитесь к системному администратору."; "Managed Software Update failed its preflight check.\nTry again later." = "Сбой предварительной проверки.\nПовторите попытку позже."; "Not installed" = "Не установлены"; diff --git a/code/Managed Software Update/sv.lproj/Localizable.strings b/code/Managed Software Update/sv.lproj/Localizable.strings index 9fdf84014017617af772c63abfc271e61e29d939..d536f777e2f1467d2c76b3705fc9cdde6d5b5d05 100644 GIT binary patch delta 12 Ucmey7^(|||Y>~}#MQ$qq058f0fdBvi delta 14 WcmeyC^&@M;Y!Sx9&9g-AC;$LDO$Olr From 06cbcd924909a1d286ee6cca89fbca79844d24e6 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Sat, 22 Mar 2014 09:16:23 -0700 Subject: [PATCH 03/10] Don't raise an exception when processing removals and a manifest refers to a non-existent catalog --- code/client/munkilib/updatecheck.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/client/munkilib/updatecheck.py b/code/client/munkilib/updatecheck.py index 1417c770..7a1f8908 100755 --- a/code/client/munkilib/updatecheck.py +++ b/code/client/munkilib/updatecheck.py @@ -2224,9 +2224,10 @@ def processRemoval(manifestitem, cataloglist, installinfo): '%s--%s' % (uninstall_item.get('name'), uninstall_item.get('version'))) processednames = [] for catalogname in cataloglist: - localcatalog = os.path.join(catalogsdir, catalogname) - catalog_pl = FoundationPlist.readPlist(localcatalog) - for item_pl in catalog_pl: + if not catalogname in CATALOG.keys(): + # in case the list refers to a non-existent catalog + continue + for item_pl in CATALOG[catalogname]['items']: name = item_pl.get('name') if name not in processednames: if 'requires' in item_pl: From e1c01a281dff702ea9df64df487aff41e6b912bc Mon Sep 17 00:00:00 2001 From: Claude PERRIN Date: Tue, 25 Mar 2014 08:09:56 +0100 Subject: [PATCH 04/10] French Translation fix typo & add more translations strings from underlying command-line tools --- .../French.lproj/Localizable.strings | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/Managed Software Update/French.lproj/Localizable.strings b/code/Managed Software Update/French.lproj/Localizable.strings index 7b6550d3..6ac91073 100644 --- a/code/Managed Software Update/French.lproj/Localizable.strings +++ b/code/Managed Software Update/French.lproj/Localizable.strings @@ -134,7 +134,7 @@ "Software removals" = "Suppression de logiciels"; /* No comment provided by engineer. */ -"Starting…" = "Démarrage…"; +"Starting..." = "Démarrage..."; /* No comment provided by engineer. */ "There are other users logged into this computer.\nUpdating now could cause other users to lose their work.\n\nPlease try again later after the other users have logged out." = "Il y a d'autres utilisateurs connectés sur l'ordinateur.\nMettre à jour peut entrainer la perte du travail des autres utilisateurs.\n\nMerci d'essayer plus tard après que les autres utilisateurs aient quitté leur session."; @@ -214,3 +214,8 @@ "Writing files..." = "Écriture des fichiers..."; +"About a" = "Environ d'"; + +"Less than" = "Moins d'"; + + From 1dc5f33edaf09b1a53d78e0f76c0e0f331e6fb44 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Tue, 25 Mar 2014 14:05:06 -0700 Subject: [PATCH 05/10] Add some Munki 2 pkginfo fields to munkiimport. --- code/client/munkiimport | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/client/munkiimport b/code/client/munkiimport index 096586a5..fd75af6a 100755 --- a/code/client/munkiimport +++ b/code/client/munkiimport @@ -764,7 +764,10 @@ def main(): 'unattended_install', 'unattended_uninstall', 'requires', - 'update_for']: + 'update_for', + 'category', + 'developer', + 'icon_name']: if key in matchingpkginfo: print 'Copying %s: %s' % (key, matchingpkginfo[key]) @@ -774,7 +777,10 @@ def main(): editfields = (('Item name', 'name'), ('Display name', 'display_name'), ('Description', 'description'), - ('Version', 'version')) + ('Version', 'version'), + ('Category', 'category'), + ('Developer', 'developer'), + ) for (name, key) in editfields: prompt = '%15s' % name default = pkginfo.get(key,'').encode('UTF-8') From e90cfccc6f59820b1e143dc8a0e182075edd6d37 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Wed, 26 Mar 2014 16:37:44 -0700 Subject: [PATCH 06/10] Add options for --category, --developer, and --icon-name to munkiimport for future use in Munki 2 --- code/client/makepkginfo | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/code/client/makepkginfo b/code/client/makepkginfo index b5ea9067..1a5f12c6 100755 --- a/code/client/makepkginfo +++ b/code/client/makepkginfo @@ -679,6 +679,21 @@ def main(): 'is \'testing\'. Can be specified multiple times to add the item ' 'to multiple catalogs.') ) + additional_options.add_option( + '--category', + metavar='CATEGORY', + help='Category for display in Managed Software Center.' + ) + additional_options.add_option( + '--developer', + metavar='DEVELOPER', + help='Developer name for display in Managed Software Center.' + ) + additional_options.add_option( + '--icon', '--iconname', '--icon-name', '--icon_name', + metavar='ICONNAME', + help='Name of icon file for display in Managed Software Center.' + ) additional_options.add_option( '--notes', metavar='STRING|PATH', @@ -879,6 +894,12 @@ def main(): catinfo['name'] = options.name if options.pkgvers: catinfo['version'] = options.pkgvers + if options.category: + catinfo['category'] = options.category + if options.developer: + catinfo['developer'] = options.developer + if options.icon: + catinfo['icon_name'] = options.icon default_minosversion = "10.4.0" maxfileversion = "0.0.0.0.0" From 35ed6c7ad0e8573dfa486e764047b2698607277b Mon Sep 17 00:00:00 2001 From: Justin McWilliams Date: Tue, 29 Apr 2014 15:51:12 -0400 Subject: [PATCH 07/10] In munkicommon.comparePlistVersion, protect against a plist parsing as NSCFString, not NSCFDictionary as expected, avoiding the following traceback: File "/usr/local/munki/managedsoftwareupdate", line 664, in main updatecheckresult = updatecheck.check(client_id=options.id) File "/usr/local/munki/munkilib/updatecheck.py", line 2777, in check installinfo) File "/usr/local/munki/munkilib/updatecheck.py", line 2071, in processManifestForKey processOptionalInstall(item, cataloglist, installinfo) File "/usr/local/munki/munkilib/updatecheck.py", line 1565, in processOptionalInstall iteminfo['installed'] = someVersionInstalled(item_pl) File "/usr/local/munki/munkilib/updatecheck.py", line 1281, in someVersionInstalled if compareItemVersion(item) == 0: File "/usr/local/munki/munkilib/updatecheck.py", line 645, in compareItemVersion return compareApplicationVersion(item) File "/usr/local/munki/munkilib/updatecheck.py", line 400, in compareApplicationVersion return compareBundleVersion(app) File "/usr/local/munki/munkilib/updatecheck.py", line 517, in compareBundleVersion compare_result = comparePlistVersion(item) File "/usr/local/munki/munkilib/updatecheck.py", line 562, in comparePlistVersion installedvers = munkicommon.getVersionString(plist) File "/usr/local/munki/munkilib/munkicommon.py", line 1345, in getVersionString if plist.get(key): AttributeError: '__NSCFString' object has no attribute 'get' --- code/client/munkilib/updatecheck.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/client/munkilib/updatecheck.py b/code/client/munkilib/updatecheck.py index 7a1f8908..3e587c42 100755 --- a/code/client/munkilib/updatecheck.py +++ b/code/client/munkilib/updatecheck.py @@ -549,6 +549,10 @@ def comparePlistVersion(item): except FoundationPlist.NSPropertyListSerializationException: munkicommon.display_debug1('\t%s may not be a plist!', filepath) return 0 + if not hasattr(plist, 'get'): + munkicommon.display_debug1( + 'plist not parsed as NSCFDictionary: %s', filepath) + return 0 if 'version_comparison_key' in item: # specific key has been supplied, From b431eb4d18163c3608d2aac36d9daaf886e88b31 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Fri, 30 May 2014 14:55:44 -0700 Subject: [PATCH 08/10] Workaround for non-ASCII characters in version strings. --- code/client/munkilib/munkicommon.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/client/munkilib/munkicommon.py b/code/client/munkilib/munkicommon.py index ef26f9c0..4ffa57b1 100755 --- a/code/client/munkilib/munkicommon.py +++ b/code/client/munkilib/munkicommon.py @@ -1265,6 +1265,10 @@ class MunkiLooseVersion (version.LooseVersion): # treat None like an empty string self.parse('') if vstring is not None: + if isinstance(vstring, unicode): + # unicode string! Why? Oh well... + # convert to string so version.LooseVersion doesn't choke + vstring = vstring.encode('UTF-8') self.parse(str(vstring)) def _pad(self, version_list, max_length): From 62986bac548f77b9c349a392f558ecddcb569e89 Mon Sep 17 00:00:00 2001 From: Arjen van Bochoven Date: Mon, 23 Jun 2014 23:33:04 +0200 Subject: [PATCH 09/10] Store verbosity level in environment variable Pre- and post-flight scripts can use verbosity level from managedinstall --- code/client/managedsoftwareupdate | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/client/managedsoftwareupdate b/code/client/managedsoftwareupdate index 8a6d55f5..1966c854 100755 --- a/code/client/managedsoftwareupdate +++ b/code/client/managedsoftwareupdate @@ -549,7 +549,10 @@ def main(): # set munkicommon globals munkicommon.munkistatusoutput = options.munkistatusoutput munkicommon.verbose = options.verbose - + + # Set environment variable for verbosity + os.environ['VERBOSE'] = str(options.verbose) + if options.installonly: # we're only installing, not checking, so we should copy # some report values from the prior run From 2af6c13f87a7b08022b059e840fcbc196fbc6532 Mon Sep 17 00:00:00 2001 From: Arjen van Bochoven Date: Wed, 25 Jun 2014 00:23:32 +0200 Subject: [PATCH 10/10] Renamed VERBOSE to MUNKI_VERBOSITY_LEVEL --- code/client/managedsoftwareupdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/client/managedsoftwareupdate b/code/client/managedsoftwareupdate index 1966c854..2492268f 100755 --- a/code/client/managedsoftwareupdate +++ b/code/client/managedsoftwareupdate @@ -551,7 +551,7 @@ def main(): munkicommon.verbose = options.verbose # Set environment variable for verbosity - os.environ['VERBOSE'] = str(options.verbose) + os.environ['MUNKI_VERBOSITY_LEVEL'] = str(options.verbose) if options.installonly: # we're only installing, not checking, so we should copy