Commit Graph

597 Commits

Author SHA1 Message Date
Justin McWilliams
d03b2ba11f Merging forced_install_after_date branch to trunk.
This adds Force Install Notifications support to the MSU GUI, and logouthelper support to managedsoftwareupdate/launchd. Documentation on using the pkginfo force_install_after_date key to come....

This merge also includes localization fixes and on-the-fly updating of the MSU GUI when managedsoftwareupdate runs in the background while the GUI is open, changing InstallInfo.

With this merge, the Munki version is increased to 0.8.0 and MSU GUI version to 3.2.


git-svn-id: http://munki.googlecode.com/svn/trunk@1270 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-08-04 19:23:19 +00:00
Justin McWilliams
0e858b098a Munki should output and log preflight output, both stdout and stderr, and should output and log postflight return codes if != 0 (even though it doesn't perform any different actions).
git-svn-id: http://munki.googlecode.com/svn/trunk@1269 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-08-04 18:35:36 +00:00
Greg Neagle
e0d43c410e Fix for updatecheck logic when multiple items to be installed require the same non-existent package.
git-svn-id: http://munki.googlecode.com/svn/trunk@1267 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-08-03 20:24:42 +00:00
Greg Neagle
1b91dfd626 - Refinement of fix for ValueError: NSInvalidArgumentException - -[__NSTaggedDate UTF8String] error on Lion when managedsoftwareupdate attempts to notify the user of available updates.
- pylint cleanups.

git-svn-id: http://munki.googlecode.com/svn/trunk@1265 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-08-02 21:11:50 +00:00
Greg Neagle
beb2ace07c Fix for ValueError: NSInvalidArgumentException - -[__NSTaggedDate UTF8String] error on Lion when managedsoftwareupdate attempts to notify the user of available updates.
git-svn-id: http://munki.googlecode.com/svn/trunk@1261 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-08-02 17:58:42 +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
ea0a373e72 Changed version.plist to 0.7.2 for Lion update and iTunes 10.4 fix.
git-svn-id: http://munki.googlecode.com/svn/trunk@1243 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-07-20 22:16:21 +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
f1a6760616 Fix for empty managed_installs or removals when printing available updates.
git-svn-id: http://munki.googlecode.com/svn/trunk@1240 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-07-20 04:18:02 +00:00
Greg Neagle
1962307e3a When looking for installed applications, if the Info.plst contains a CFBundleIdentifier, never fall back to comparing by CFBundleName.
Remove .encode('UTF-8') for items being sent to munkicommon.display_debug2, since that function does an .encode('UTF-8') as well.

git-svn-id: http://munki.googlecode.com/svn/trunk@1233 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-07-13 03:38:48 +00:00
John Randolph
c0ef9f25d0 add new key minimum_update_version to installs items.
this key describes the minimum version # which will be targetted 
for update when Munki is discovering installed versions.

real world example:
  set minimum_update_version=4.0 on Firefox4, Firefox3.x will not be touched.



git-svn-id: http://munki.googlecode.com/svn/trunk@1225 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-06-22 19:52:09 +00:00
John Randolph
6a324e25e7 supply missing module import
git-svn-id: http://munki.googlecode.com/svn/trunk@1218 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-06-20 20:21:12 +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
John Randolph
20867d6c9e merge in changes from /branches/force_install_after_date/
git-svn-id: http://munki.googlecode.com/svn/trunk@1207 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-06-03 18:55:30 +00:00
Greg Neagle
b33739f931 Updated copyright info printed when managedsoftwareupdate runs.
git-svn-id: http://munki.googlecode.com/svn/trunk@1204 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-27 16:37:43 +00:00
Greg Neagle
c95c6f9fb8 Update license and copyright info on manifstutil.
git-svn-id: http://munki.googlecode.com/svn/trunk@1202 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-26 22:28:16 +00:00
Greg Neagle
f2c74b3bcf Fix for copyFromDMG: when copying an item not at the root of the DMG, the path of the copy destination was not being determined properly, leading to "No such file or directory" errors when setting owner, group and mode of the destination item.
git-svn-id: http://munki.googlecode.com/svn/trunk@1200 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-25 21:11:32 +00:00
Greg Neagle
51f79798e1 makepkginfo now allows "naked" pre- and postuninstall_script options (that is, no package needed):
makepkginfo --preuninstall_script=/path/to/script
makepkginfo --postuninstall_script=/path/to/script

git-svn-id: http://munki.googlecode.com/svn/trunk@1199 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-25 17:09:18 +00:00
Greg Neagle
c776e3d121 installer.py: change to runScript() to ensure we capture all output from scripts; previously if there was still output in the buffer when the script completed running it was possible we would not read it all.
git-svn-id: http://munki.googlecode.com/svn/trunk@1198 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-25 16:42:54 +00:00
Greg Neagle
daf17f0997 No longer split uninstall_method on spaces; allows for a path to an uninstall script with spaces in the pathname.
git-svn-id: http://munki.googlecode.com/svn/trunk@1195 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-24 22:51:40 +00:00
Greg Neagle
e6b8343407 Fix so pre- and postuninstall_scripts get copied to InstallInfo.plist.
git-svn-id: http://munki.googlecode.com/svn/trunk@1194 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-24 19:07:47 +00:00
Greg Neagle
e7945ec94c manifestutil now ignores manifests whose name begins with a "."
git-svn-id: http://munki.googlecode.com/svn/trunk@1193 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-24 17:44:32 +00:00
Greg Neagle
c31343d0ff Initial commit of manifestutil
git-svn-id: http://munki.googlecode.com/svn/trunk@1192 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-24 17:25:53 +00:00
Greg Neagle
b176a55c0d Add support for pre- and postuninstall_script options to makepkginfo.
git-svn-id: http://munki.googlecode.com/svn/trunk@1191 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-24 02:40:26 +00:00
Greg Neagle
da9defca18 Add support for preuninstall_script and postuninstall_script.
git-svn-id: http://munki.googlecode.com/svn/trunk@1190 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-23 21:22:53 +00:00
Greg Neagle
1de09d5117 Better conversion of 'update_for" items from strings to lists of strings if needed.
git-svn-id: http://munki.googlecode.com/svn/trunk@1189 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-20 22:10:49 +00:00
Greg Neagle
8c518912b8 Make updatecheck more forgiving if admin specifies a "requires" or "update_for" key as a string instead of an array of strings.
git-svn-id: http://munki.googlecode.com/svn/trunk@1188 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-20 22:00:53 +00:00
MagerValp
986a45d395 Reverting r1186, library files don't require executable bit.
git-svn-id: http://munki.googlecode.com/svn/trunk@1187 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-20 13:35:09 +00:00
MagerValp
c3fb0ff0ec Fixed missing executable bit.
git-svn-id: http://munki.googlecode.com/svn/trunk@1186 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-20 09:31:24 +00:00
Greg Neagle
eda80319fb Better parsing of name and version from pkg/dmg names for makepkginfo and munkiimport.
git-svn-id: http://munki.googlecode.com/svn/trunk@1177 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-12 17:06:36 +00:00
Greg Neagle
77bd5fcbe5 Initial code for eventual discovery of apps and other bundles in packages.
git-svn-id: http://munki.googlecode.com/svn/trunk@1173 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-11 15:20:04 +00:00
Greg Neagle
96ee3fa575 When running embedded scripts (preinstall, postinstall, uninstall), pipe STDERR to STDOUT so we can capture all output more easily.
git-svn-id: http://munki.googlecode.com/svn/trunk@1172 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-10 15:23:04 +00:00
Greg Neagle
3dce11a31b Expand '~' and '~username' constructions in paths to pre/post/uninstall_scripts.
git-svn-id: http://munki.googlecode.com/svn/trunk@1166 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-06 04:13:09 +00:00
Greg Neagle
02316f0c36 Additional status output when running embedded scripts.
git-svn-id: http://munki.googlecode.com/svn/trunk@1165 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-05 23:11:52 +00:00
Greg Neagle
f6f28d8255 Add:
--postinstall_script
  --preinstall_script
  --uninstall_script
options to makepkginfo to assist in embedding these kinds of scripts.

git-svn-id: http://munki.googlecode.com/svn/trunk@1164 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-05-05 21:03:17 +00:00
Greg Neagle
57fa34e0fe Added blocking_applications to the list of pkginfo keys that get copied from the previous version to a munkiimport of a newer version.
git-svn-id: http://munki.googlecode.com/svn/trunk@1155 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-29 21:41:36 +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
96d117741d Supervisor should exit with the return code of the process it started, not 0 if there are no errors.
git-svn-id: http://munki.googlecode.com/svn/trunk@1142 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-25 20:23:43 +00:00
Justin McWilliams
ab255c82a8 ManagedInstallReport::InstallResults dictionaries now include duration_seconds for each install. This can be sent to reporting servers to keep track of install durations, potentially even averaging durations across a sample size allowing admins to message this in pkginfo descriptions; for example, on Simian this is automatic.
git-svn-id: http://munki.googlecode.com/svn/trunk@1138 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-21 18:35:23 +00:00
Greg Neagle
96d1c5be19 Still trying to fix pkgtemplate commits
git-svn-id: http://munki.googlecode.com/svn/trunk@1128 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-19 15:50:25 +00:00
Justin McWilliams
81e560d696 oops, fixing indentation ;/
git-svn-id: http://munki.googlecode.com/svn/trunk@1120 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-15 21:51:56 +00:00
Justin McWilliams
1687e8be9b Display "Performing postflight tasks...." before running an existing postflight script, to explain the delay between "No changes to managed software are available." and the script exiting.
git-svn-id: http://munki.googlecode.com/svn/trunk@1119 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-15 21:50:18 +00:00
Greg Neagle
7fdaa2ad53 Updated warning message when processing removals and item info cannot be found to match the warnings given when processing installs and updates.
git-svn-id: http://munki.googlecode.com/svn/trunk@1116 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-13 22:39:51 +00:00
Justin McWilliams
4046754270 Merge supervisor branch (r1110, r1111, r1114) into trunk.
Summary:
- wrap entire managedsoftwareupdate execution and kill if open for 12 hours.
- move "delay/sleep" logic into supervisor, removing need for updatecheckhelper (but keep updatecheckhelper around so clients continue to work without reloading launchd)


git-svn-id: http://munki.googlecode.com/svn/trunk@1115 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-13 21:57:02 +00:00
Justin McWilliams
86fff493d3 pythonScriptRunning() should only find python processes where the script running (first arg) is <scriptname>, not processes where <scriptname> exists anywhere in the argument list.
Example, where <scriptname> == 'managedsoftwareupdate':
  Still find: /usr/bin/python managedsoftwareupdate
  Don't find: /usr/bin/python foo.py --argbar managedsoftwareupdate


git-svn-id: http://munki.googlecode.com/svn/trunk@1109 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-11 22:58:24 +00:00
Justin McWilliams
4c31fdaf81 Merge r1107 into trunk, adding timeout to installer executions to self-heal from hung installs (as seen with Apple SUS updates for iTunes and Java on 10.5.x).
git-svn-id: http://munki.googlecode.com/svn/trunk@1108 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-11 22:44:24 +00:00
Greg Neagle
80c7bd1243 updatecheck.fileSystemItemExists(item) now returns true when given a path to a symlink if the symlink exists but the item it points to does not. Previously it returned false if the target was missing.
git-svn-id: http://munki.googlecode.com/svn/trunk@1105 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-11 18:18:13 +00:00
Justin McWilliams
f17935640c Enhancement of r1103, cleaning up how getIdleSeconds() works.
git-svn-id: http://munki.googlecode.com/svn/trunk@1104 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-11 15:32:13 +00:00
Justin McWilliams
53d16dd778 Fix but in getIdleSeconds() where ioreg output is split, but there are inconsistent number of whitespaces.
I ran into a machine where "parts" was:  ['|', '|', '"HIDIdleTime"', '=', '1458195167613966'], and since parts[3] is "=" getIdleSeconds() was crashing trying to convert it to int().

So return int(int(parts[3])/1000000000) should really be parts[4] on this machine, but this may be inconsistent on different machines?

# /usr/sbin/ioreg -c IOHIDSystem -d 4 | grep Idle
   | |     "HIDIdleTime" = 1458351496253133

So let's just use regex to parse the integer out of the line more safely.



git-svn-id: http://munki.googlecode.com/svn/trunk@1103 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-09 15:10:46 +00:00
Justin McWilliams
c0a9403e63 Syntax fix for r1098.
git-svn-id: http://munki.googlecode.com/svn/trunk@1102 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-08 17:59:31 +00:00