Commit Graph

85 Commits

Author SHA1 Message Date
Greg Neagle
365c739949 makecataogs: Adjusted warning text when items differing only by case are detected. 2017-04-07 11:16:23 -07:00
Greg Neagle
e042a2c8d5 Move many functions shared by the various cli tools to munkilib/cliutils.py 2017-03-13 08:03:23 -07:00
Greg Neagle
d1d3f5dcd2 Move code that uses FileRepo as a default if no repo is specified to munkilib/munkirepo/__init__.py 2017-03-11 09:06:09 -08:00
Greg Neagle
bcf53074df makecatalogs: handle the following cases 1) no /path/to/repo; 2) no --repo-url 3) Existing repo_path preference 2017-03-10 13:29:43 -08:00
Greg Neagle
60bea033cf Extra caution to always default to FileRepo if plugin value is None or '' 2017-03-10 12:16:37 -08:00
Greg Neagle
f9ac3c776b makecatalogs and munkiimport working with new-style FileRepo plugin 2017-03-08 21:53:46 -08:00
Greg Neagle
0fb1d3cefa Begin reorg of repo plugins code 2017-03-04 08:19:29 -08:00
Greg Neagle
d7087dc6a5 Merge branch 'master' into cloudrepo 2017-02-24 08:18:38 -08:00
Greg Neagle
4b4bbb8aac When running makecatalogs where PyObjC is not available, make note about the use of plistlib less alarming. 2017-02-19 20:32:10 -08:00
Greg Neagle
1f90b8d039 Merge https://github.com/ryanyu91/munki into cloudrepo 2017-02-14 09:34:15 -08:00
Greg Neagle
4053a0dbe7 Update copyright dates to 2017 2017-01-17 20:14:31 -08:00
Ryan Yu
0afd9e1913 NEW CHANGES
************************************************************************************************************************************************************************************
https://github.com/munki/munki/pull/689#pullrequestreview-16492427
Commit based on comments by Greg Neagle on what to fix: munki#689 (master...ryanyu91:master)

makecatalogs:
removed debugging print statements

manifestutil:
check if repo is initialized before checking if it is mounted

munkiimport:
check if repo is initialized before checking if it is mounted
for def add_icon_hash_to_pkginfo(pkginfo):, not opening file (icon_path) anymore
WE_MOUNTED_THE_REPO is a repo attribute now, instead of a global variable

FileRepo:
removed duplicate/unused imports
changed class to not be old-style
updated glob method since pkgs was uninitialized
made WE_MOUNTED_THE_REPO from global variable to FileRepo attribute variable initialized to False

iconimporter:
updated Repo call to include 3 parameters now..
changed old find_items_to_check calls to new call: findItemsToCheck

Repo.py
Added support for relative paths for importing plugins
************************************************************************************************************************************************************************************

Commit based on comments by Greg Neagle on what to fix: munki#685 (master...ryanyu91:master)
IconImporter:

Not opening DMG and then mounting it anymore, directly mounting like how it was before
ManifestUtil:
Checking if the repo is mounted as well as if we (munki) mounted it. Only this will display prompt whether we want to unmount or not
FileRepo.py, Repo.py:
not hardcoding import path anymore
FileRepo - added 10.12 mounting fileshares code
************************************************************************************************************************************************************************************

Changed Files:
code/client/munkiimport
code/client/iconimporter
code/client/makecatalogs
code/client/manifestutil
code/client/munkilib/iconutils.py

Added Files:
code/client/munkilib/FileRepo.py
code/client/munkilib/Repo.py

Reason For Changes:

The purpose for this change is to enable plugins to munki that will allow writes to the munki repo to be customized.

Changes:

The methods used to write to the munki repo are the target of this modification. A plugin can create new methods for overwriting the default behavior of writing to the munki repo.

The default behavior is retained in the absence of a plugin. This is accomplished via the introduction of FileRepo.py which continues to simply write changes to the munki repo. A plugin can be introduced to change this default behavior and allow munki repo writes to be redirected as desired by the plugin author.

In order to accomplish this we have refactored all of the os.path.* methods, as well as the mount, unmount and available methods from the following tools: (iconimporter, makecatalogs, munkiimport, manifestutil, iconutils), and put them into a different python script to be used as a library or common code module. By default, these are now in the FileRepo.py module. The plugin can be used to overwrite this common code module.

In addition to the above described changes, we also made the following changes to support this plugin
concept:
•	Added the ability to add a plugin either via the command line or via munkiimport –configure
•	The code will look for custom plugins in the /usr/local/munki/munkilib/plugins/ directory
•	If plugin is found in the plugins directory, munkiimport --configure will give the option to type in the plugin name. For example, if you plugin is Foo.py, you could specify a plugin name of Foo in munkiimport --configure
•	If no plugin is found the FileRepo.py module will be used as the default common code module for writing to the munki repo
•	Add the ability to set the plugin via the --plugin option for the following tools (makecatalogs, munkiimport, manifestutil)

Testing
Tested with munkiimport on local filesystem/network shares/our own custom plugins
Tested manifestutil on local filesystem/network
Verified through regression testing, all features of munkiimport, makecatalogs, iconimporter, manifestutil from before all still work (local filesystem/network shares)
2017-01-16 13:46:53 -08:00
Ryan Yu
1a8ba6b8db Updated help text for plugin option for make catalogs 2016-12-20 14:28:01 -08:00
Ryan Yu
1b01fd4b89 fix refactoring for make catalogs 2016-12-14 14:52:00 -08:00
Ryan Yu
0c475075e4 Refactored iconimporter, makecatalogs, manifestutil, iconutils Repo methods to Repo/FileRepo to support custom plugin functionality 2016-12-14 13:31:48 -08:00
gmarnin
c68204d167 Fix for https://github.com/munki/munki/issues/666 2016-09-29 14:22:33 -04:00
Greg Neagle
12d4f0d27e Update copyright info on files; remove abandoned tools from code/tools 2016-03-15 09:32:28 -07:00
Samuel Keeley
23d2e85545 Merge branch 'master' into samuel-docs 2015-11-20 14:54:19 -08:00
Samuel Keeley
b44ae33ca0 Update OS X text 2015-11-13 20:57:25 -08:00
Samuel Keeley
67513852fc Replace internal documentation URLs with HTTPS versions 2015-11-13 20:42:50 -08:00
Samuel Keeley
5c12185da4 Replace http://www.apache.org/licenses/LICENSE-2.0 with https://www.apache.org/licenses/LICENSE-2.0 2015-11-13 20:35:24 -08:00
Brian Warsing
ee1bcac831 follow symlinks when walking pkgs and pkgsinfo
To protect against infinite recursion, `os.walk` will not follow symlinks by
default. However, this safety feature can hamper the utility of makecatalogs if
admins want to symlink-in resources from multiple munki repos, so turn it off.
2015-05-01 11:13:18 -07:00
Nick McSpadden
72e6901cc2 Fixed indentation issue 2015-04-15 09:58:19 -07:00
Nick McSpadden
938f50ead9 TABS 2015-03-20 10:26:17 -07:00
Nick McSpadden
6877101604 Better future-proof check for uninstaller_item_location
AdobeCCPUninstaller _must_ have an uninstaller_item_location key. If
uninstaller_item_location is specified, it must be valid.
2015-03-20 10:24:57 -07:00
Nick McSpadden
01c0b5393d Supports AdobeUberUninstaller removal 2015-03-16 10:00:52 -07:00
Nick McSpadden
34769fb436 Revert "Now works with other "Adobe" uninstaller_types"
This reverts commit a77c42b2a9.
2015-03-13 15:04:18 -07:00
Nick McSpadden
a77c42b2a9 Now works with other "Adobe" uninstaller_types 2015-03-13 12:58:07 -07:00
Nick McSpadden
2c140e915a Added uninstaller_item_location check to makecatalogs 2015-03-13 12:12:32 -07:00
Samuel Keeley
4ed5e4e381 checking for name key in makecatalogs, fixes #450 2015-02-12 06:19:37 -08:00
Greg Neagle
4fcc78985a Code formatting fix for makecatalogs 2015-01-23 12:33:43 -08:00
Greg Neagle
9f7a0598dc Merge branch 'master' of https://github.com/munki/munki
Conflicts:
	code/client/makecatalogs
2015-01-23 11:34:56 -08:00
Greg Neagle
e4fb9cac47 PyLint cleanups for makecatalogs; also define errors array before use by iconhashing code 2015-01-23 11:26:19 -08:00
Samuel Keeley
a85a071745 pylint fixes 2015-01-23 11:25:25 -08:00
Samuel Keeley
be33651d43 remove one more line 2015-01-22 23:00:55 -08:00
Samuel Keeley
3f0af4438d simplification 🍐 2015-01-22 22:01:18 -08:00
Samuel Keeley
94cf5870bc more 80 chars and suggested simplification 2015-01-22 14:17:57 -08:00
Samuel Keeley
a7ceae35d4 remove redundancy and lines > 80 chars 2015-01-22 14:11:17 -08:00
Samuel Keeley
93659f0c63 add .png to icon_name check 2015-01-21 11:20:36 -08:00
Samuel Keeley
eda254fefa fix a bunch of problems with icon hashing 2015-01-21 09:24:46 -08:00
Samuel Keeley
3bb3b62b13 sha256 2015-01-21 07:46:50 -08:00
Samuel Keeley
d71a4e4708 don't break when no icons directory 2015-01-21 07:42:38 -08:00
Samuel Keeley
4e3bd4f0f2 iconspath 2015-01-20 22:01:18 -08:00
Samuel Keeley
c22537aa3d modify makecatalogs to automatically generate icon hashes and insert them into catalogs 2015-01-20 21:43:46 -08:00
Greg Neagle
fddd138000 Bumping version to 1.0.0. Updated copyright dates. 2014-01-10 08:20:15 -08:00
Greg Neagle
11aa83062f makepkginfo now inserts some user/environment metadata into generated pkginfo files. It stores the metadata under the '_metadata' key. makecatalogs now strips any key starting with _ from pkginfo before adding the pkginfo to a catalog. 2013-11-04 10:43:06 -08:00
Greg Neagle
c34745b82a Attempt to adjust makecatalogs to play nicer with PackageURL and PackageCompleteURL keys in pkginfo files 2013-07-22 09:37:18 -07:00
Greg Neagle
bb3ff68892 Unicode filename fixes for makecatalogs. 2013-04-04 12:08:26 -07:00
Greg Neagle
98de6685cc Merge of https://code.google.com/r/theheig-conditionals/ apple-update-metadata: Adds support for Munki-style metadata to Apple updates. 2013-02-19 17:09:40 -08:00
Greg Neagle
defd773d60 Some PyLint cleanups for makecatalogs 2013-02-12 20:19:41 -08:00