Commit Graph

327 Commits

Author SHA1 Message Date
Greg Neagle 7233ea384c Fix for downloading uninstaller items as supported for Adobe CS4 uninstalls. This was accidentally broken during the optimization of package integrity checking (so it was my fault, not Justin's!)
git-svn-id: http://munki.googlecode.com/svn/trunk@875 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-27 20:38:11 +00:00
Greg Neagle ab2118c3ed Additional debugging messages in updatecheck; record items that are managed_updates to avoid items disappearing from the optional_installs list if they are also in managed_updates.
git-svn-id: http://munki.googlecode.com/svn/trunk@874 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-26 23:45:03 +00:00
MagerValp 54a32d304d Added dummy svnversion file so that munkitools run straight from svn returns "0.7.0.svn.0".
git-svn-id: http://munki.googlecode.com/svn/trunk@870 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-26 20:06:03 +00:00
Greg Neagle b901118418 Fix doc string formatting.
Re-check idle time when running in "checkandinstallatstartup" mode so we maximize our chances of getting all the updates done when bootstrapping.

git-svn-id: http://munki.googlecode.com/svn/trunk@869 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-26 18:52:06 +00:00
Justin McWilliams 7afec5b605 Better implementation of r863; move verifyFileOnlyWritableByMunkiAndRoot() and runExternalScript() to new munkilib utils module that is 100% free of ObjC-dependant Python.
git-svn-id: http://munki.googlecode.com/svn/trunk@865 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-26 16:32:48 +00:00
Greg Neagle 963c5c319b Fix a too-long line in updatecheck.py
git-svn-id: http://munki.googlecode.com/svn/trunk@864 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-26 15:35:07 +00:00
Justin McWilliams 9a566d108e Move verifyFileOnlyWritableByMunkiAndRoot() from munkicommon to managesoftwareupdate, so it can be used without importing munkicommon.py.
This is in prep of a upcoming notification feature that cannot depend on ObjC Py bindings.  Alternatively, if we want to share such code, we can create a common/util module for only Pure-Python code, and doc that it should not contain any ObjC imports.


git-svn-id: http://munki.googlecode.com/svn/trunk@861 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-26 13:15:13 +00:00
Greg Neagle 331813da86 get_version() now looks for and reads two files in the munkilib directory:
version.plist
svnversion

git-svn-id: http://munki.googlecode.com/svn/trunk@859 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-26 05:21:54 +00:00
Greg Neagle 91ba0a4af2 New munkilib/version.plist to keep track of the version.
git-svn-id: http://munki.googlecode.com/svn/trunk@858 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-26 05:20:07 +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 d693e7ac4b For optional installs, if there is not enough disk space to install the item, do not display a warning so we don't get spurious warnings in ManagedSoftwareUpdateReport.plist
git-svn-id: http://munki.googlecode.com/svn/trunk@855 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-25 17:41:53 +00:00
John Randolph be912bca2f merge finalized branch /get-apps-nfs-detect into trunk
git-svn-id: http://munki.googlecode.com/svn/trunk@854 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-25 17:23:23 +00:00
MagerValp 99037fe71d munkicommon.format_time() updated to use Foundation.NSDate().
git-svn-id: http://munki.googlecode.com/svn/trunk@853 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-25 16:09:58 +00:00
MagerValp 35563cb6e0 Changed ManagedInstallReport.plist timestamps to ISO 8601 format, with timezone information.
git-svn-id: http://munki.googlecode.com/svn/trunk@852 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-25 14:48:03 +00:00
Greg Neagle 1e4c4c74dc Clean up some vestiges of the support for aliases.
If there's a download error, make sure what gets sent to munkicommon.display_error is a string; otherwise we get an unhandled exception when writing out our report.

Add "localmanifestpath" option to updatecheck.check(). This may be used if I implement the alternate Apple Software Update mechanism, and should also be useful for a future Puppet package provider or any programmatically-generated manifest.

git-svn-id: http://munki.googlecode.com/svn/trunk@847 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-24 04:13:20 +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 f9d1b2b3bd Fix unhandled exception in munkicommon.prefs() when the prefs file is missing by replacing orphaned "prefsfile" with "MANAGED_INSTALLS_PLIST_PATH"
git-svn-id: http://munki.googlecode.com/svn/trunk@829 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-20 16:41:10 +00:00
Greg Neagle b52f45cdf0 More print statement cleanup.
git-svn-id: http://munki.googlecode.com/svn/trunk@821 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-19 17:22:55 +00:00
Greg Neagle b78ba8e03c More cleanup -- replacing print statements with calls to munkicommon.display_* methods.
git-svn-id: http://munki.googlecode.com/svn/trunk@820 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-19 17:15:41 +00:00
Greg Neagle fbb20c5ac5 Tweaks to what gets printed to stdout and stderr during a run; overall effect is to make managedsoftwareupdate quieter by default.
git-svn-id: http://munki.googlecode.com/svn/trunk@819 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-19 17:03:28 +00:00
Greg Neagle 27a4aafbc8 Don't record the forced_install or foreced_uninstall key if the item requires a restart or logout, or is part of a dependency relationship.
git-svn-id: http://munki.googlecode.com/svn/trunk@817 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-19 03:42:25 +00:00
Greg Neagle a127ec769d If running with only_forced=True, remove the forced_* items from the managed_installs list and the removals list and rewrite InstallInfo.plist.
git-svn-id: http://munki.googlecode.com/svn/trunk@816 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-19 03:28:54 +00:00
Justin McWilliams 7f44c0c40e - s/unattended/forced/
- separate forced_installs and forced_uninstalls, so they one can be forced while the other is not.
 - move status output enabling to the only place it's necessary; --auto at login window.
 - move forced install run to top of "GUI user exists" conditional instead of two places within.  (Greg, please verify this is okay).



git-svn-id: http://munki.googlecode.com/svn/branches/unattended-installs@813 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-18 19:08:39 +00:00
Justin McWilliams dc5c2e373d Run forced/unattended updates before checking if the user should be notified; notify them afterwards if any remaining attended installs remain.
1) disable status output (GUI)
2) run unattended installs
3) reenable status output (GUI)
4) notify user or remaining installs (if LastModifiedDate is happy)

Also, change logging a little to make it easier to see difference between regular install run and unattended run.


git-svn-id: http://munki.googlecode.com/svn/branches/unattended-installs@812 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-18 17:59:06 +00:00
Justin McWilliams fedb392b9b First iteration of forced/unattended/silent installs.
Notes:
 - Needs documentation about how risky this is, and how it should only be used
for simple packages that are known to be safely installed while app is running.
 - If notification is popped up, it will contain the unattended install; if
notification is not due to be popped up the unattended install will be installed
immediately.
  - Only works in --auto mode (which is what launchd execs); I will test more tomorrow with manual runs, as we may be able to do this before --installonly too.



git-svn-id: http://munki.googlecode.com/svn/branches/unattended-installs@809 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-18 00:25:18 +00:00
Greg Neagle 2330ddfc70 changed getLSInstalledApplications() to ignore paths beginning with '/Volumes/' instead of those beginning with '/Volumes'.
git-svn-id: http://munki.googlecode.com/svn/trunk@788 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-13 17:57:54 +00:00
Greg Neagle efdd7628bd Changed munkicommon.getAppData() to use LaunchServices instead of Apple System Profiler. LaunchServices is faster and returns more apps than System Profiler, especially on Leopard systems. Thanks to John Randolph.
git-svn-id: http://munki.googlecode.com/svn/trunk@787 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-13 17:32:53 +00:00
Greg Neagle 68aa8cee64 Fix for getAppData() -- when moved to munkicommon, forgot to change munkicommon.display_debug1() to display_debug1()...
git-svn-id: http://munki.googlecode.com/svn/trunk@784 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-08 17:58:07 +00:00
Justin McWilliams af1df39f68 curl() fixes.
1) fix OSError because nonexistent file is attempted to be read if HTTP status=200 but response yields no download; this happens if local Cache package is *newer* than package on the server (curl receives 200 but doesn't download); instead raise HTTPError.

   2) In the event of a curl() download error, delete any existing cache files
related to the failed download (destination or tmp names). This is basically
just resetting state after any download failures that aren't resume related,
one of those failures being the temp download file doesn't exist.

   This fixes a problem where if the destination exists and the date (header:
If-Modified-Since) is newer than on the server (header: Last-Modified), the curl
binary does not ever download the older file.  In this case Munki never has a
.download temp file, so it can't overwrite the original/newer file. A susequent
Munki execution will download the older server file.



git-svn-id: http://munki.googlecode.com/svn/trunk@783 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-07 21:29:24 +00:00
Greg Neagle 4d9af60e5a updateAcrobatPro: when looking for the apps to update, first look in /Applications/Adobe Acrobat 9 Pro/ before asking system_profiler to search.
git-svn-id: http://munki.googlecode.com/svn/trunk@782 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-07 18:34:44 +00:00
Greg Neagle 1dab884671 Replace separate instances of getAppData() in adobeutils.py and updatecheck.py with a single implementation in munkicommon.
git-svn-id: http://munki.googlecode.com/svn/trunk@781 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-07 18:07:50 +00:00
Greg Neagle 29d4c264b1 Added some additional status and debug messages for package integrity testing and managed_updates.
git-svn-id: http://munki.googlecode.com/svn/trunk@780 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-07 17:16:21 +00:00
Greg Neagle 6aaddbfe7f Attempt to be a little smarter about which payloads we add to the installs list for Adobe CS5 updaters when generating pkginfo. Now we look for a payload whose name matches that of the overall update and add only that payload if it exists, falling back to the previous behavior if it does not.
git-svn-id: http://munki.googlecode.com/svn/trunk@779 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-06 18:19:32 +00:00
Justin McWilliams 4a86af1770 Moving secure plist (r773) to Apple provided location: /private/var/root/Library/Preferences/
git-svn-id: http://munki.googlecode.com/svn/trunk@776 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-05 14:42:05 +00:00
Justin McWilliams ad3b1275a2 Merging r772 into trunk; add Secure Config for sensitive preferences/configs.
git-svn-id: http://munki.googlecode.com/svn/trunk@773 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-04 21:27:18 +00:00
Greg Neagle e2698bb44f Move verifySoftwarePackageIntegrity check inside of download_installeritem().
getHTTPfileIfChangedAtomically now returns a boolean indicating if the item was downloaded (True) or just returned from the local cache (False). This way, we only do the expensive SHA-256 checksum comparison on the initial download.

getHTTPfileIfChangedAtomically now raises exceptions if it runs into trouble, as does download_installeritem().

git-svn-id: http://munki.googlecode.com/svn/trunk@764 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-27 22:53:52 +00:00
Greg Neagle 795ddeb481 Another commit to get the build number in sync with the SVN revision number. Gah.
git-svn-id: http://munki.googlecode.com/svn/trunk@759 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-21 23:31:29 +00:00
Greg Neagle f07e01655b 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
2010-09-21 23:30:06 +00:00
Greg Neagle 257dfffd2c Bump build number in get_version() to 755.
git-svn-id: http://munki.googlecode.com/svn/trunk@755 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-14 23:57:10 +00:00
Justin McWilliams 41ccc6c3ef Reload preferences from ManagedInstalls.plist after preflight execution in case preflight changed any preferences.
git-svn-id: http://munki.googlecode.com/svn/trunk@754 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-13 23:05:56 +00:00
Justin McWilliams fc3ff13fb6 Moving 'AdditionalHttpHeaders' ManagedInstalls.plist string to munkicommon const for cleaner reuse in preflight/postflight.
git-svn-id: http://munki.googlecode.com/svn/trunk@753 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-13 22:47:02 +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 f88b74c116 pylint cleanup: mark unused variables, add docstring and fix indentation in removeItemFromSelfServeUninstallList()
git-svn-id: http://munki.googlecode.com/svn/trunk@751 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-13 17:37:49 +00:00
Greg Neagle b0619cf035 pylint cleanup: mark unused variables
git-svn-id: http://munki.googlecode.com/svn/trunk@750 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-13 17:35:32 +00:00
Greg Neagle eceedc0e86 pylint cleanups: mark unused variables.
git-svn-id: http://munki.googlecode.com/svn/trunk@749 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-13 17:34:47 +00:00
Greg Neagle 231e309ae4 filesystemItemExists() now returns 0 if the item doesn't exist, 1 if it exists and the checksum matches (or there is no checksum provided), or -1 if the item exists but the checksum does not match. This should make someVersionInstalled() work better with pkginfo that relies on files in the installs key.
processManifestForOptionalInstalls(), processManifestForManagedUpdates(), processManifestForInstalls(), and processManifestForRemovals(), which ll shared a very similar structure, have been refactored and replaced with processManifestForKey().

Various pylint cleanups: marking unused variables, global variable names are now all CAPS, added some docstrings, 

Removed all remaining references to aliases. (support for aliases was removed a long time ago, but some references still remained in the code)

Removed support for "modifies" dependency type, which was deprecated months ago.

git-svn-id: http://munki.googlecode.com/svn/trunk@748 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-13 17:03:39 +00:00
Greg Neagle 4491ae9b03 Initial support for managed_updates in manifests. Items listed in managed_updates will have updates downloaded and applied if any prior version is installed (subject to munki using pkginfo information to determine if an item is installed).
git-svn-id: http://munki.googlecode.com/svn/trunk@747 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-10 19:23:13 +00:00
Justin McWilliams b36b32672b munkicommon.py & updatecheck.py: Use single quotes for all non-doctstring strings.
git-svn-id: http://munki.googlecode.com/svn/trunk@745 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-10 03:29:47 +00:00
Justin McWilliams 184d5368c2 Clean some lint on updatecheck: reorder imports, replace single-quote docstrings with double, etc
git-svn-id: http://munki.googlecode.com/svn/trunk@744 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-09-10 02:01:15 +00:00