fix to r924: on suppresscheck still need to consider whether cached apple updates are available.

git-svn-id: http://munki.googlecode.com/svn/trunk@930 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
Rob Middleton
2010-11-27 05:54:57 +00:00
parent 1ff5d190fa
commit e55faec0aa

View File

@@ -420,8 +420,31 @@ def appleSoftwareUpdatesAvailable(forcecheck=False, suppresscheck=False):
if suppresscheck:
# typically because we're doing a logout install; if
# there are no waiting Apple Updates we shouldn't
# trigger a check for them
return False
# trigger a check for them. However we do need to
# return True if cached updates are waiting. This
# will allow logoutinstall / installonly operations
# to succeed.
updatesindexfile = '/Library/Updates/index.plist'
if os.path.exists(appleUpdatesFile) and \
os.path.exists(updatesindexfile):
appleUpdatesFile_modtime = os.stat(appleUpdatesFile).st_mtime
updatesindexfile_modtime = os.stat(updatesindexfile).st_mtime
if appleUpdatesFile_modtime > updatesindexfile_modtime:
# if munki's update summary is current
displayAppleUpdateInfo()
return True
else:
# updatesindexfile is newer, use it to generate a new
# appleUpdatesFile
if writeAppleUpdatesFile():
displayAppleUpdateInfo()
return True
else:
return False
else:
# munki doesn't know of any cahced Apple updates
return False
elif forcecheck:
# typically because user initiated the check from
# Managed Software Update.app