The previous addition of '--max-os-ver', '--min-os-ver', and
'--unattended-install' prompted this change to provide similar naming
conventions across all options.
This resolves an edge case where an incomplete makepkginfo option may
be at the end of a string. Prepending would "complete" the incomplete
option. By appending, we're ensuring that the option cannot be
completed by the string "--verify-options-only"
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.
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.
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.
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.
'--makepkginfo-options' option has been removed in favor of providing
'makepkginfo' options alongside options native to 'munkiimport'.
This is accomplished by collecting all unknown options into
'arguments', which includes '/path/to/installer_item'.
Keeping with conventions typical for performing operations on a file,
'/path/to/installer_item' should always be last.
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.
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.
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.
Any option available to 'makepkginfo' can be specified using the
'makepkginfo-options' flag.
Example:
munkiimport --makepkginfo-options="-c production -c testing
--description='A good description' --unattended_install
--minimum_os_vers=10.6.8" /path/to/pkg-or-dmg"
Previously, admin-provided conditions were written to the
'ConditionalItems' dict. Some built-in information was also being
written to the 'MachineInfo' dict, however this is not fully
representative of all built-in conditions that are collected. Since
INFO_OBJECT is used as the basis for predicate comparison, its entirety
will be written to the 'Conditions' dict in
'ManagedInstallReport.plist', replacing 'ConditionalItems'. The
'MachineInfo' dict will remain untouched as it is used for reporting
mechanisms.