Commit Graph

100 Commits

Author SHA1 Message Date
Adam Reed
5c51cefb8f Automate the setting of minimum_os_version to the highest detected OS version dependent upon what we automatically detect from the installer items and / or file item(s) in the following situations:-
* makepkginfo with installer item - set minimum_os_version as detected
* makepkginfo with installer item and file item(s) - set minimum_os_version as detected
* makepkginfo with file item(s) only - do not provide minimum_os_version, regardless of what we detect
* makepkginfo with --minimum_os_version and any of the above options - set minimum_os_version to argument of --minimum_os_version, regardless of what we detect

This patch also sets flat packages to default to 10.5.0 (instead of 10.4.0 which is used for all other items) and requires that if --minimum_os_version is provided that it starts with a digit.
2012-09-05 12:33:35 +10:00
Heig Gregorian
b3705ea7b5 Fixes to force unmount call; __CFPREFERENCES_AVOID_DAEMON environment variable set to '1' upon makepkginfo invocation 2012-08-22 14:40:18 -07:00
Heig Gregorian
ca3786fe8a Fix for cfprefsd interference; ensure that stdout stream only contains pkginfo xml and not messages intended for the user. 2012-08-22 13:49:57 -07:00
Timothy Sutton
93ca31bd3b Further refactoring for hasValid extension check functions
- hasValidPackageExt(), hasValidDiskImageExt() for the appropriate
  extensions, and hasValidInstallerItemExt() to call them
- replace many checks to use the above
- munkiimport.py now uses munkicommon.isApplication() to do the
  equivalent of checking endswith('.app')
- fix an errand merge ancestor from an old unrelated munkiimport
  branch
2012-07-11 13:56:23 -04:00
Heig Gregorian
66a4b763c0 Minor changes to wording of "destination item (name)" option to indicate that it is a name and not a full path.
This option is now stored as 'options.destitemname'
2012-07-06 10:17:43 -07:00
Heig Gregorian
eb75e13be9 Typo fixed for setting 'blocking_applications' array
Option is called '--block_application', however, it should be written
as 'blocking_applications' to the pkginfo dict.
2012-07-06 08:53:48 -07:00
Heig Gregorian
af723cb710 Updates to help docs provided by "drag-n-drop" options such that they don't explicitly refer to what's been set by '--item', but rather the item that's been copied.
Option help takes on a more generic tone to reflect the possibility
that '--destinationitem' has been specified.
2012-07-03 16:10:39 -07:00
Heig Gregorian
147acdd92a Inline documentation added to provide a bit of clarity 2012-07-03 08:53:46 -07:00
Heig Gregorian
2e05588206 Improved help output for '--destinationitem' option.
Explicitly states that the "installs" item's path is modified such that
it includes the alternate name as opposed to the disk image item's
original name.
2012-07-03 08:45:53 -07:00
Heig Gregorian
647cb861f4 Support for providing 'destination_item' name when processing a "drag n drop" installation. 2012-07-02 12:54:21 -07:00
Heig Gregorian
ebbeaf7c4c Added support for "(un)installcheck_script" inclusion into a pkginfo file.
Syntax is the same as any previous script embed.
2012-06-29 11:30:06 -07:00
Greg Neagle
b4eb55cd84 makepkginfo now warns when provided a read/write disk image, and does not generate an installer_item_hash. 2012-06-27 16:06:09 -07:00
Heig Gregorian
798c721ec6 Added option to specify uninstall method; '--uninstall_method' 2012-05-31 06:54:56 -07:00
Heig Gregorian
f2bdb2a0d2 Specifying stand-alone --installer_environment options allows for the generation of the 'installer_environment' dict
This is similar to generating an 'installs' array of dicts.
2012-05-23 09:31:13 -07:00
Greg Neagle
1841b79866 PyLint formatting cleanups 2012-05-22 15:39:14 -07:00
Heig Gregorian
5c54651577 Improved handling of empty 'installer_environment' 2012-05-22 13:32:34 -07:00
Heig Gregorian
84455e5ef3 Init installer_environment_dict in case its creation goes badly 2012-05-22 12:47:51 -07:00
Heig Gregorian
b4e908c952 Formatting update to stay at or under 80 columns 2012-05-22 11:02:32 -07:00
Heig Gregorian
3ccfedd931 Added --installer_environment option 2012-05-22 09:19:31 -07:00
Heig Gregorian
5b7db50146 Descriptions updated for '--autoremove, -requires, --update_for, and --notes'; blocking applications option is now --blocking_application to match similar singular usage of --catalog, etc. 2012-05-22 07:19:35 -07:00
Heig Gregorian
725fb0f4cc Abbreviated "PACKAGE" and "APPLICATION" metavars 2012-05-21 18:26:30 -07:00
Heig Gregorian
6682b863ca Added support for newly introduce 'minimum_munki_version' pkginfo key. 2012-05-21 18:22:05 -07:00
Heig Gregorian
b6bf37369d Cleaner '--force_install_after_date' help print out 2012-05-21 18:06:08 -07:00
Heig Gregorian
44a54bd69d Minor help formatting clean-up 2012-05-21 17:18:06 -07:00
Heig Gregorian
89afee0a17 Re-work of options in meaningful categories, complete with easier to read formatting
Also removed 'options.appdmg' check since this options no longer exists.
2012-05-21 16:54:24 -07:00
Heig Gregorian
343a43fdfe Reorganization of options printed from usage statement
Option list has become quite large and required some type of
organizational structure.  This is an attempt to provide that.
2012-05-15 20:26:41 -07:00
Heig Gregorian
b2a8066d6c '--vers' option conflicts with '--version'; changed to '--pkgvers' 2012-05-11 08:29:21 -07:00
Heig Gregorian
284587203a '--name' and '--vers' options added
As with '--display_name', if specified, these 2 new options override
discovered package information.
2012-05-11 08:17:03 -07:00
Heig Gregorian
d855f3125c Added hyphenated equivalents to every option that includes underscores
The previous addition of '--max-os-ver', '--min-os-ver', and
'--unattended-install' prompted this change to provide similar naming
conventions across all options.
2012-05-09 07:34:13 -07:00
Heig Gregorian
5db39f6e7c Re-worked '--verify-options-only' function in makepkginfo. def makePkgInfo now assumes that the installer_item is located in the 'options' passed to it; added dedicated 'test_mode' variable.
Assuming that the installer_item is part of 'options' passed to 'def
makePkgInfo' simplifies the function as well as several other parts of
'munkiimport'; namely the removal of installer_item from the list of
arguments is no longer needed.  Additional exit codes added to
--verify-options-only are interpreted by 'def makePkgInfo' testing mode.
2012-05-08 07:31:17 -07:00
Heig Gregorian
d8a2623877 munkiimport / makepkginfo communications simplified by exiting if more than one potential installer_item has been specified.
Note that since the '/path/to/installer_item' could still be anywhere
within munkiimport options, it is essential to remove it from the
options list passed to 'makepkginfo' during pkginfo creation.
2012-05-07 19:58:18 -07:00
Heig Gregorian
6dbbe4c047 Added a '--verify-options-only' option to makepkginfo. Munkiimport makes use of this new option to derive installer_item. The overall result is that now, the /path/to/installer_item may be anywhere in the options string, however only the first /path/to/installer_item will be used.
def makePkgInfo can be passed an 'item_path' of "None" in order to
invoke the testing mode and its interpretation of various exit codes
including the presumed /path/to/installer_item and ignoring any
additional installer_items specified.
2012-05-07 13:35:22 -07:00
Heig Gregorian
f4f72174be Added new function to read an option_value as either a plain string or path to file
Since adding the '--notes' option, which can either be a simple string
or the contents of a file (if a valid path is supplied), this same
functionality has been extended to the '--description' option.

Providing a function so that this same operation can be used in other
areas seemed like the logical thing to do.
2012-05-03 11:14:34 -07:00
Heig Gregorian
01c3db99e6 Added alternate option names for 3 items specified as options in 'munkiimport' which are now present as options for 'makepkginfo' 2012-05-02 20:56:43 -07:00
Heig Gregorian
6d45a7108b '--notes' option added
Notes provide an area for administrators to store information that is
purely reserved for administrative use and not considered in any type
of munki processing.
2012-05-01 18:35:33 -07:00
Heig Gregorian
c8ad63c707 Added tolerance to '--RestartAction' option
If a valid restart action is not provided, use best guess by keying
words "restart" and "logout" if they're provided within the argument's
string.
2012-05-01 15:43:30 -07:00
Heig Gregorian
534a8a1ac5 Usage information updates for "update_for, requires, and blocking_applications" 2012-05-01 14:37:17 -07:00
Heig Gregorian
bafb9a1701 '--autoremove' option added for 'makepkginfo'
Improved option usage information.
2012-05-01 14:22:09 -07:00
Heig Gregorian
03e6ddc1aa Three new array options for 'makepkginfo' added
--update_for - populates the 'update_for' array
--requires - populates the 'requires' array
--blocking_applications - populates the 'blocking_applications' array
2012-05-01 14:16:22 -07:00
Heig Gregorian
bd42067450 Added '--RestartAction' option to 'makepkginfo'
Valid actions that can be specified are:
RequireRestart
RequireLogout
RecommendRestart
2012-05-01 13:44:33 -07:00
Heig Gregorian
b4ba365fe9 Added '--force_install_after_date' option to 'makepkginfo'; uses a new function defined in 'munkicommon.py' for validation (see below).
munkicommon.validateForceInstallAfterDateFormat may be useful in other
areas.

The function is tolerant to some "errors" such as single-digit month or
day or even two-digit year.
2012-05-01 11:39:16 -07:00
Heig Gregorian
1e0d0842c7 Argument passed to 'getChoiceChangesXML' now matches the argument used in preceding calls to 'getPackageMetaData'
Minor usage note changed for '--installer_choices_xml' as well as
proper os_version comparison as to NOT exclude Mac OS X 10.6.6.

Modified 'munkicommon.getChoiceChangesXML' to return 'choices' even if
empty.
2012-05-01 08:49:46 -07:00
Heig Gregorian
ad90d63611 Options added to makepkginfo
--unattended_install
--unattended_uninstall
--minimum_os_version
--minimum_os_version
--installer_choices_xml (ONLY 10.6.6 or later)

Code to generate installer_choices_xml added to munkicommon.py library.
2012-04-30 18:53:55 -07:00
Greg Neagle
0e0f0b48b0 Clearer error message when more than one argument is given to makepkginfo and munkiimport. 2012-01-17 08:33:08 -08: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
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
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
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
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
1c9e5784c1 - forced_installs and forced_uninstalls now work with items that are part of a dependency relationship
- makecatalogs now has no OS X-specific dependencies

- munkiimport fixes for repos hosted via SMB/CIFS.

git-svn-id: http://munki.googlecode.com/svn/trunk@1097 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-06 21:54:29 +00:00