Automatic Apple Updates

This adds support for automatic unattended installation of Apple updates.  It is intended to cut down on the need for creating pkginfos just to add unattended_install keys.

Setting `AutomaticAppleUpdates` to true will cause all Apple updates which do not require a logout or restart to be treated as unattended, getting the blocking applications list from the Apple distribution.

It is currently limited to just Yosemite and newer, though it can likely be extended down to Mavericks.  The behavior is similar to when "Install OS X updates" is set to true in the App Store's preferences.
This commit is contained in:
Samuel Keeley
2016-01-28 17:38:39 -08:00
committed by Samuel Keeley
parent 39cf5e8f52
commit e9986c4439
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -1651,8 +1651,12 @@ class AppleUpdates(object):
'Error reading: %s', self.apple_updates_plist)
return item_list, product_ids
apple_updates = pl_dict.get('AppleUpdates', [])
os_version_tuple = munkicommon.getOsVersion(as_tuple=True)
for item in apple_updates:
if item.get('unattended_install'):
if (item.get('unattended_install') or
(munkicommon.pref('AutomaticAppleUpdates') and
item.get('RestartAction', 'None') = 'None' and
os_version_tuple >= (10, 10))):
if munkicommon.blockingApplicationsRunning(item):
munkicommon.display_detail(
'Skipping unattended install of %s because '
+1
View File
@@ -1214,6 +1214,7 @@ def pref(pref_name):
'SuppressStopButtonOnInstall': False,
'PackageVerificationMode': 'hash',
'FollowHTTPRedirects': 'none',
'AutomaticAppleUpdates': False,
}
pref_value = CFPreferencesCopyAppValue(pref_name, BUNDLE_ID)
if pref_value == None: