Commit Graph

79 Commits

Author SHA1 Message Date
Greg Neagle 2ac635afac add back the return of SoftwareUpdate's return code at the end of AppleUpdates._RunSoftwareUpdate(). Mistakenly removed on Feb 15 2012 in revision 2a1cf963e4 2012-04-13 13:55:46 -07:00
Greg Neagle 97c670bab4 appleupdates.py now generates blocking_applications lists for Apple updates 2012-03-13 17:22:54 -07:00
Greg Neagle 2a1cf963e4 Fix issue where managedsoftwareupdate --auto or --quiet would print percentage-done indicators to STDOUT when checking for Apple updates or when removing packages. 2012-02-15 15:17:09 -08:00
Greg Neagle 34ab750460 Changes to allow curl to follow redirects when retreiving an Apple sucatalog; this is needed to support Lion Server's Software Update service. 2012-02-14 16:51:34 -08:00
Justin McWilliams 6c06a48fd7 Clean up appleupdates.GetSoftwareUpdateResource and RetrieveURLToCacheDir docstrings. 2012-01-24 12:05:26 -05:00
Greg Neagle ca03bb0325 Output tweaks; munkicommon.mountdmg() can now mount disk images containing End User License Agreements 2012-01-04 13:54:04 -08:00
Greg Neagle 96a2536141 appleupdates.py output tweaks; updated tests 2011-12-22 14:32:13 -08:00
Greg Neagle 5651b2a9a4 appleupdates.py now sets User-Agent header; munki-specific cert and header stuff moved to updatecheck; tests updated 2011-12-22 14:01:27 -08:00
Greg Neagle 03a6136ea0 Change appleupdates.py to use fetch.py for downloads 2011-12-21 16:36:52 -08:00
Greg Neagle c916885e03 Added munkicommon.display_status_major and renamed munkicommon.display_status to munkicommon.display_status_minor; changes to more closely map the munkistatus-style output to the stdout-style output 2011-12-21 11:28:52 -08:00
Justin McWilliams 571a6a3f38 Don't log repetitive lines when running softwareupdate; only log if the stdout
has changed since the last loop iteration.

This should change things like:

Nov 16 13:12:03 Registering updated applications…
...
Nov 16 13:12:19 Registering updated applications…
Nov 16 13:12:19 Registering updated applications…
Nov 16 13:12:20 Registering updated applications…
Nov 16 13:12:20 Registering updated applications…
Nov 16 13:12:21 Registering updated applications…
Nov 16 13:12:21 Registering updated applications…
Nov 16 13:12:22 Registering updated applications…
Nov 16 13:12:22 Writing package receipts…
Nov 16 13:12:23 Writing package receipts…
Nov 16 13:12:23 Writing package receipts…
Nov 16 13:12:24 Writing package receipts…
Nov 16 13:12:24 Writing package receipts…
Nov 16 13:12:25 Writing package receipts…
Nov 16 13:12:25 Writing package receipts…
...
Nov 16 13:12:59 Writing package receipts…

To simply:

Nov 16 13:12:03 Registering updated applications…
Nov 16 13:12:22 Writing package receipts…
2011-11-17 14:34:34 -05:00
Greg Neagle a41af3b7f9 Revert "Beginning of refactor for getResource/curl methods"
This reverts commit 821e9072cc.
2011-09-29 16:39:57 -07:00
Greg Neagle 821e9072cc Beginning of refactor for getResource/curl methods 2011-09-29 16:24:23 -07:00
Greg Neagle 31dee71a55 Fix for issue when MSU.app is launched by managedsoftwareupdate more than one minute after an updatecheck run has completed (due to unattended installs, apple update checking, or combo) and add AppleUpdates to ManagedSoftwareReport.plist 2011-09-20 20:01:55 -07:00
Greg Neagle 957998c87d Fixed (again) appleupdates.GetSoftwareUpdatePref method to respect MCX 2011-08-26 12:29:49 -07:00
Justin McWilliams 2fdd6fdcfb Merging (well, moving) refactored appleupdates module, unit tests, and runtests.sh to master branch. 2011-08-24 12:42:19 -04:00
Greg Neagle 91be98ae2d Fix so reading com.apple.SoftwareUpdate prefs respects MCX 2011-08-23 11:25:18 -07:00
Justin McWilliams 9d470035c2 Bug fix for appleupdates.AvailableUpdatesAreDownloaded() where productKey is not in downloaded dict. 2011-08-17 08:32:29 -04:00
Justin McWilliams 4543948aad Cleanup appleupdates style, move default catalog urls to constant dict, make new getOsVersion() method instead of parsing uname, etc.
git-svn-id: http://munki.googlecode.com/svn/trunk@1286 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-08-11 18:41:48 +00:00
Greg Neagle e6106f0345 Change run_softwareupdate to use ptyexec tool if available.
git-svn-id: http://munki.googlecode.com/svn/trunk@1285 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-08-11 16:58:10 +00:00
Greg Neagle 843212a881 Updated comments for TODOs.
git-svn-id: http://munki.googlecode.com/svn/trunk@1283 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-08-10 22:03:45 +00:00
Justin McWilliams cb85f5beb1 Move scattered Apple Software Update catalog name and path strings to constants, with comments describing each of them (some with TODOs to add comments).
git-svn-id: http://munki.googlecode.com/svn/trunk@1282 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-08-10 21:41:34 +00:00
Justin McWilliams 567af9fc2e r1277 added a 'time' key to the ManagedInstallReport:InstallResults dicts, which was an epoc timestamp. 'time' is now a [date] value, filled using NSDate.new().
git-svn-id: http://munki.googlecode.com/svn/trunk@1279 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-08-08 17:41:09 +00:00
Justin McWilliams 8294821bc7 ManagedInstallReport:InstallResults dicts now has a 'time' key which is the epoc time when the install took place. This is helpful when reporting may be delayed to future executions of Munki.
git-svn-id: http://munki.googlecode.com/svn/trunk@1277 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-08-08 16:18:12 +00:00
Justin McWilliams c6008abbc0 Apple Software Update fixes for environments where CatalogURL is already a file:// URL, not a http:// URL.
- s/getHTTPfileIfChangedAtomically/getResourceIfChangedAtomically/
- getFileIfChangedAtomically should urllib2.unquote paths, in case they came from the file:// URL.


git-svn-id: http://munki.googlecode.com/svn/trunk@1273 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-08-05 16:36:47 +00:00
Greg Neagle 93b350e7cb Merge changes from apple_update branch to trunk.
git-svn-id: http://munki.googlecode.com/svn/trunk@1259 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-08-02 15:09:11 +00:00
Greg Neagle 259efe634f Fix for <None> nodeValues in distribution files -- affects Apple Software Updates. Problem first encountered in iTunes 10.4 update.
git-svn-id: http://munki.googlecode.com/svn/trunk@1242 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-07-20 22:03:25 +00:00
Greg Neagle 1d8a66b0a5 Attempt at fix for Software Update.app launching at loginwindow under Leopard when munki checks for Apple Software Updates at loginwindow. Symptom was Software Update menu bar appearing at loginwindow.
git-svn-id: http://munki.googlecode.com/svn/trunk@1214 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-06-10 17:36:00 +00:00
Justin McWilliams 820f88f364 Don't crash when calling checkForSoftwareUpdates() on 10.5.x if /System/Library/CoreServices/Software Update.app does not exist. (problem seen in field; likely user deleting it, but unknown at the time).
Also protect against softwareupdate not existing, or Software Update.app disappearing between stat/chmod and Popen() calls.


git-svn-id: http://munki.googlecode.com/svn/trunk@1153 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-27 15:27:36 +00:00
Justin McWilliams 3882257b46 Change ManagedInstallReport::InstallResults to be a list of dictionary install results instead of list of strings. InstallResults dictionaries now look like the following:
{
  'name': 'Foo Package Install Name Without Version',  # display_name or name
  'version': '1.0.0.0',  # version_to_install
  'applesus': False,  # or True for Apple SUS installs.
  'status': 0,  # retcode, so 0 for success otherwise 1, 2, -1, -5, etc
}

Install.log output stays roughly the same, only prepending "Apple SUS" to such install strings.


git-svn-id: http://munki.googlecode.com/svn/trunk@1056 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-03-07 19:57:50 +00:00
Greg Neagle 6e188c8cc7 Tweaks to better parse out the Software Update title, version and description from a wider variety of valid dist files.
git-svn-id: http://munki.googlecode.com/svn/trunk@1017 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-02-01 06:03:49 +00:00
Greg Neagle a853f78c9f Update copyright dates across the board.
git-svn-id: http://munki.googlecode.com/svn/trunk@1010 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-01-25 18:22:14 +00:00
Greg Neagle 8b54baa1c0 munkicommon: change to Spotlight search so we can bail if the search takes too long.
appleupdates: replace os.path.relpath() with something that also works under Leopard.

git-svn-id: http://munki.googlecode.com/svn/trunk@1003 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-01-18 20:10:27 +00:00
Greg Neagle 7384ca44f5 Changes in getSoftwareUpdateInfo() and processSoftwareUpdateDownload() to properly parse Apple Software Updates under Leopard.
git-svn-id: http://munki.googlecode.com/svn/trunk@1002 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-01-17 21:31:35 +00:00
Greg Neagle c2534d5cc8 Replaced instance of "os.listdir" with "munkicommon.listdir" in appleupdates.processSoftwareUpdateDownload()
git-svn-id: http://munki.googlecode.com/svn/trunk@998 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-01-14 23:45:57 +00:00
Greg Neagle abe3d2a1de appleupdates.py now creates its own .dist files to manage installation of downloaded Apple Software Updates, replacing the earlier technique of just installing the individual packages in filename order.
In most invocations of subprocess.Popen, change the bufsize from 1 to -1, which changes from line-buffered to "big" buffers.

Other minor changes to align with the appleupdates,py changes and some pylint-recommended cleanup.

git-svn-id: http://munki.googlecode.com/svn/trunk@995 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-01-14 19:11:05 +00:00
Greg Neagle 681acae624 Add MCX support, based on code contribution from Dan Roque.
Other minor clean-ups.

git-svn-id: http://munki.googlecode.com/svn/trunk@973 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-12-13 20:11:22 +00:00
Greg Neagle a0820fe027 Added more logging/debug logging to experimental "softwareupdatename" support for pkginfo.
git-svn-id: http://munki.googlecode.com/svn/trunk@967 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-12-10 00:10:10 +00:00
Greg Neagle 503cdf7ec5 Added support for 'softwareupdatename' in pkginfo
git-svn-id: http://munki.googlecode.com/svn/trunk@949 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-12-03 22:19:05 +00:00
Rob Middleton 098d450c67 fix to r912: installer.installWithInfo got an extra return parameter. The call to it from within appleupdates.installAppleUpdates needed changing to be consistent. Without that change restartneeded was being read as true in all cases.
git-svn-id: http://munki.googlecode.com/svn/trunk@944 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-12-01 04:48:08 +00:00
John Randolph ffe6722d87 wrap os.listdir() to decode utf-8 unicode into unicode objects
change all code locations using os.listdir() to use munkicommon.listdir()



git-svn-id: http://munki.googlecode.com/svn/trunk@941 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-11-30 16:28:45 +00:00
Greg Neagle 1136569854 Simplify the logic in appleSoftwareUpdatesAvailable() when suppresscheck is True.
git-svn-id: http://munki.googlecode.com/svn/trunk@932 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-11-29 18:23:35 +00:00
Rob Middleton e55faec0aa 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
2010-11-27 05:54:57 +00:00
Greg Neagle 337bb70150 More changes to Apple Software Update logic: if /Library/Updates/index.plist exists, we check values from /Library/Preferences/com.apple.SoftwareUpdate.plist -- LastResultCode and LastSuccessfulDate --to attempt to determine if index.plist is still valid, or if it may be stale.
git-svn-id: http://munki.googlecode.com/svn/trunk@926 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-11-23 18:38:33 +00:00
Greg Neagle a77c1329fb Simplified check for available Apple Software Updates to avoid presenting stale info to user.
git-svn-id: http://munki.googlecode.com/svn/trunk@924 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-11-22 18:13:04 +00:00
Greg Neagle c682755898 Fix for missing LastSuccessfulDate in /Library/Preferences/com.apple.SoftwareUpdate.plist
git-svn-id: http://munki.googlecode.com/svn/trunk@857 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-25 19:01:49 +00:00
Greg Neagle 775f592608 New softwareUpdatePrefs() function to replace all the calling out to "defaults read"
git-svn-id: http://munki.googlecode.com/svn/trunk@856 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-25 18:45:58 +00:00
Greg Neagle 64144bfe17 Log when we skip an Apple Software Update check
git-svn-id: http://munki.googlecode.com/svn/trunk@830 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-20 16:49:41 +00:00
Greg Neagle 9cd9708514 pylint cleanup: mark unused variable.
git-svn-id: http://munki.googlecode.com/svn/trunk@752 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-13 17:38:34 +00:00
Greg Neagle 4f74f2806f Fixing dumb attempt to improve the quality of output from softwareupdate...
git-svn-id: http://munki.googlecode.com/svn/trunk@736 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-09 17:09:34 +00:00