Commit Graph

114 Commits

Author SHA1 Message Date
Greg Neagle
6b4ad647c4 Update copyright dates 2025-01-25 15:35:09 -08:00
Greg Neagle
36769cdbbc Revert "Change all shebangs in prep for Python 3.12 (where symlinks to the Python executable are broken)"
This reverts commit fdec07b615.
2024-02-23 10:49:00 -08:00
Greg Neagle
fdec07b615 Change all shebangs in prep for Python 3.12 (where symlinks to the Python executable are broken) 2024-02-23 09:05:16 -08:00
Greg Neagle
2b327569b4 Update copyright dates 2024-01-30 16:14:29 -08:00
Greg Neagle
767f64b12a Update copyright info 2023-02-22 09:59:22 -08:00
Greg Neagle
5ee0f5928a Update copyright dates 2022-05-10 16:09:38 -07:00
Greg Neagle
e80604f2a2 Change shebangs of makecatalogs and repoclean to reference munki-python.
This will reduce the support burden when Apple's Python is removed in macOS 12.3.
People running these tools on non-macOS platforms will need to edit the shebang lines or call via their preferred Python.
2022-01-28 08:51:30 -08:00
Greg Neagle
9d3e265cb8 Update copyright dates 2021-02-20 09:05:58 -08:00
Taylor Boyko
b56fb552b4 Support repo-based makecatalogs (#1012)
* if repo plugin has a makecatalogs method defined, use it instead

* pass options and output_fn to repo makecatalogs method
2020-08-18 16:17:12 -07:00
Greg Neagle
72a0535d0d Update Copyright dates 2020-01-01 08:53:37 -08:00
Greg Neagle
7ff576f159 Python 3 compatibility fixes 2019-07-13 18:21:54 -07:00
Greg Neagle
234d186e81 Python 3 compatibility changes for makecatalogs 2019-06-22 22:17:15 -07:00
Greg Neagle
a6d43a2b3c Python 3 compatibility for makecatalogs 2019-05-29 21:19:25 -07:00
Greg Neagle
df60207145 Add 'from __future__ import absolute_import' to all files to enforce Python3-style imports 2019-05-03 21:34:56 -07:00
Greg Neagle
531d99a01a Convert all print statements to Python3-compatible print functions 2019-05-03 19:47:37 -07:00
Elliot Jordan
2ad27ff411 Align except clauses with PEP 3110 (#933)
This should work for Python 2.6+, including 3.
https://www.python.org/dev/peps/pep-3110/#compatibility-issues
2019-05-03 15:05:13 -07:00
Greg Neagle
918d0b7391 Update copyright dates 2019-01-02 10:31:50 -08:00
Elliot Jordan
70a4bd21a3 Add missing spaces in help strings (#857) 2018-06-12 08:22:28 -07:00
Greg Neagle
1428c40d06 Update copyright notices to include 2018 2018-01-20 08:46:22 -08:00
Greg Neagle
255f5762f5 Move reusable code from makecatalogs into munkilib/admin/makecatalogslb.py 2017-11-19 17:30:22 -08:00
Yoann Gini
04b33642b3 An option to silently skip pkg check (#795)
Add --skip-pkg-check (-s) option
This PR add a manual option to skip the pkg_check process in addition to PackageCompleteURL & PackageURL based detection.
Manual request for this option is usefull when a unique server contain data and metadata but both are push from different sources. (Like GIT + rsync)
The difference with the force option rely in the warning message that are avoided here and the check done on the metadata part aren't skiped.
2017-08-23 15:34:43 -07:00
Samuel Keeley
a66e52fd57 Don't hash icon hashes plist (#783) 2017-06-16 21:44:49 -07:00
Greg Neagle
c479539b4f Merge from master 2017-06-13 14:25:34 -07:00
Greg Neagle
0252e091d1 Fix makecatalogs behavior when there is an invalid repo_url to match that of munkiimport 2017-06-13 13:49:48 -07:00
Greg Neagle
bccb7523ac Store icon hashes in a seperate file; this makes icon downloaded far more efficient since we don't have to even try to download a non-existent icon 2017-06-11 12:24:13 -07:00
Greg Neagle
3085dbd36b Commit dev code 2017-06-09 08:25:18 -07:00
Greg Neagle
2e56c59b62 Fix issues with icon hashing in makecatalogs 2017-05-11 14:31:07 -07:00
Greg Neagle
dbf85e79c6 Address issue #764 -- warning when icons are in subdirectory of icons dir. 2017-05-04 10:22:19 -07:00
Clayton Burlison
5e754bc5e7 fix: Remove duplicate --plugin flag (#751)
This removes the duplicate --plugin flag from the help menu of:
* iconimporter
* makecatalogs
* munkiimport
* repoclean
2017-04-22 00:03:43 -05:00
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