Commit Graph

56 Commits

Author SHA1 Message Date
Timothy Sutton 6e6b050a37 fix for munkiimport only checking dmgs and apps - should check hasValidInstallerItemExt() 2012-07-11 15:25:25 -04: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
Greg Neagle 1841b79866 PyLint formatting cleanups 2012-05-22 15:39:14 -07:00
Heig Gregorian 08e49636df Safer prepend of '--verify-options-only'. Fixed broken pkginfo generation due to installer_item being wrapped into dmg and original installer_item not being removed from 'arguments' and the new dmg not being added to 'arguments' 2012-05-08 11:58:14 -07:00
Heig Gregorian c6e23fbbd1 Improved usage print out by adding an epilog describing 'makepkginfo' option usage
Minor addition to 'PassThroughOptionParser' class to suppress default
formatting of 'epilog'.
2012-05-08 11:06:17 -07:00
Heig Gregorian a919e1c669 When 'def makePkgInfo' testing mode is invoked, prepend '--verify-options-only' instead of appending
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"
2012-05-08 09:13:11 -07:00
Heig Gregorian 4f8ffeec40 Improved error interpretation for makePkgInfo testing mode 2012-05-08 08:33:18 -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 855fb9986c Revert "Converted '--configure' option as a callback."
This reverts commit a2c593be9c.
2012-05-03 18:54:22 -07:00
Heig Gregorian a2c593be9c Converted '--configure' option as a callback.
--configure as a callback eliminates the need to check if the option
has been set to 'True'
2012-05-03 09:03:15 -07:00
Heig Gregorian 557ada518c Changes to how the 'installer_item' is removed from 'arguments' (presumed to be options for 'makepkginfo'). Removed redundant options which can now be referenced as 'makepkginfo' options. Nicer error reporting for 'makepkginfo' options failure 2012-05-02 21:01:48 -07:00
Heig Gregorian e74ecb583d Re-worked handling of passing 'makepkginfo' options through 'munkiimport'
'--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.
2012-05-02 13:08:41 -07:00
Heig Gregorian 27e820f6c4 Minor usage update to '--makepkginfo-options' 2012-05-01 12:01:32 -07:00
Heig Gregorian 8aa107c843 Revert "Removed redundant options in 'munkiimport' as they are now present in 'makepkginfo' and can be triggered using the '--makepkginfo-options=' option."
This reverts commit 3349335fa7.
2012-05-01 11:59:56 -07:00
Heig Gregorian 3349335fa7 Removed redundant options in 'munkiimport' as they are now present in 'makepkginfo' and can be triggered using the '--makepkginfo-options=' option.
Minor update to usage for '-makepkginfo-options' and provided an
example.
2012-05-01 11:36:30 -07:00
Heig Gregorian 467899b5bd Relocated the import of the 'shlex' module to other module imports for clarity
Minor modification to construction of 'cmd' in 'def makePkgInfo'
2012-05-01 08:59:39 -07:00
Heig Gregorian 9c5ade47d3 Option to pass 'makepkginfo-style' options added
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"
2012-04-30 19:34:38 -07:00
Greg Neagle 3fcf49ffc4 Fix munkiimport to look in default install location for makecatalogs if makecatalogs is not found in same directory as munkiimport. Thanks to Heig Gregorian 2012-04-27 10:23:45 -07:00
Greg Neagle 00e0407d6e Merge branch 'cli' of https://code.google.com/r/davvid-munki-cli 2012-02-29 10:24:28 -08:00
Greg Neagle 7c910a1180 makecatalogs now skips all files that start with a period. Minor output tweak in munkiimport. 2012-02-28 20:58:07 -08:00
David Aguilar 3510b3b994 munkiimport: Add --unattended-install flag
Allow setting the 'unattended_install' package metadata
from the command-line.
2012-02-28 13:48:31 -08:00
David Aguilar 91bdbd6ec7 munkiimport: Add --min-os-ver and --max-os-ver options
Allow setting the maximum_os_version and minimum_os_version
package info fields from the command-line.
2012-02-28 11:30:17 -08:00
Greg Neagle 6804a86fb9 Merge branch 'cli' of http://code.google.com/r/davvid-munki-cli 2012-02-23 14:43:57 -08:00
Greg Neagle ba47144877 makecatalogs now will attempt to use the repo_path defined using munkiimport --configure if no repo path is given on the command line. All errors and warnings are now printed at the end to increase their visibility. munkiimport updated to (normally) suppress most of makecatalog's output unless --verbose is given. 2012-02-23 14:42:54 -08:00
David Aguilar bec6f53c3d munkiimport: Specify catalogs from the command-line
Add a --catalog option so that we can specify the default
catalogs to use from the command-line.  Multiple catalogs can
be specified by specifying the option multiple times.
2012-02-22 17:49:41 -08:00
Greg Neagle 6b9f040461 munkiimport: encode all key values in UTF-8 before printing 2012-02-14 08:23:54 -08: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 25a9315cba mount_nfs fix for munkiimport and manifestutil 2011-09-13 15:14:32 -07:00
Lars Fronius e45f31fe07 Why shouldn't manifestutil and munkiimport use nfs, and why shouldn't it be the same function for both? 2011-09-05 15:08:26 +02:00
Greg Neagle d821429830 Change sample munki repo URLs to use example.com in keeping with RFC 2606: http://tools.ietf.org/html/rfc2606 2011-08-26 17:12:14 -07: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
Greg Neagle d4261af782 munkiimport will copy the old forced_install and forced_uninstall keys as well as the new unattended_* keys to improve backwards compatibility.
git-svn-id: http://munki.googlecode.com/svn/trunk@1101 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-08 17:12:38 +00:00
Justin McWilliams e84453eb5f s/forced_(un)install/unattended_(un)install/g
s/only_forced/only_unattended/g

Change forced_* pkginfo key names to more accurately describe what's happening, since they're not "forced" in the true sense of the word.

Admins should include both forced_* and unattended_* keys in their pkginfos while migrating to client releases after this change, to ensure both old and new clients have desired pkg push agressiveness :(


git-svn-id: http://munki.googlecode.com/svn/trunk@1098 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-04-08 16:23:45 +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
Greg Neagle 685314da25 Fix so PyObjC __NSDate and __CFDate objects are converted to strings (previously we only did __NSCFDate) . Need to revisit date handling to/from CFPreferences...
git-svn-id: http://munki.googlecode.com/svn/trunk@1046 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-02-25 00:18:56 +00:00
Greg Neagle 1002eb7a26 munkiimport: Only offer to unmount the repo if we mounted it in the first place.
git-svn-id: http://munki.googlecode.com/svn/trunk@1028 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-02-11 18:28:05 +00:00
Greg Neagle 72c8b0ac50 Fixed typo in munkiimport.findMatchingPkginfo()
git-svn-id: http://munki.googlecode.com/svn/trunk@1027 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-02-10 21:37:30 +00:00
Greg Neagle 69705bb33e Change version number handling to eliminate padding/truncating version numbers to five positions (ala 1.0.0.0.0).
git-svn-id: http://munki.googlecode.com/svn/trunk@1016 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2011-01-31 21:38:47 +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 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 26bc156996 Exit if makepkginfo returns empty pkginfo.
git-svn-id: http://munki.googlecode.com/svn/trunk@952 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-12-08 18:47:45 +00:00
Greg Neagle 35d8757faf munkiimport now searches the repo for pkg/installer_items that match the one currently being imported to allow you to make a new version of a package consistent with a previous version.
git-svn-id: http://munki.googlecode.com/svn/trunk@947 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-12-01 21:04:28 +00:00
Greg Neagle 849c79d041 Print better error messages when repo path is missing expected directories.
git-svn-id: http://munki.googlecode.com/svn/trunk@894 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-11-08 17:39:28 +00:00
Greg Neagle fbeaadbe48 Change shebang to use installed Python, not environment's Python.
git-svn-id: http://munki.googlecode.com/svn/trunk@887 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-11-03 00:03:04 +00:00
Greg Neagle 595cc334cd Fix for unicode characters in pkg name or description
git-svn-id: http://munki.googlecode.com/svn/trunk@885 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-29 21:17:48 +00:00
Greg Neagle 3db9b52cda Minor docstring and output tweaks.
git-svn-id: http://munki.googlecode.com/svn/trunk@882 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-28 18:59:57 +00:00
Greg Neagle 6045ae8516 munkiimport now optionally runs makecatalogs after importing an installer item
git-svn-id: http://munki.googlecode.com/svn/trunk@879 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-27 23:57:09 +00:00
Greg Neagle 4c4f34d064 makePkgInfo() now uses the makepkginfo in the same directory as munkiimport if it exists.
git-svn-id: http://munki.googlecode.com/svn/trunk@878 a4e17f2e-e282-11dd-95e1-755cbddbdd66
2010-10-27 22:05:58 +00:00