autopkg-wrapper 2024.5.2__py3-none-any.whl → 2024.5.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- autopkg_wrapper/__init__.py +1 -1
- autopkg_wrapper/autopkg_wrapper.py +24 -16
- autopkg_wrapper/utils/args.py +9 -1
- {autopkg_wrapper-2024.5.2.dist-info → autopkg_wrapper-2024.5.5.dist-info}/METADATA +8 -8
- autopkg_wrapper-2024.5.5.dist-info/RECORD +13 -0
- {autopkg_wrapper-2024.5.2.dist-info → autopkg_wrapper-2024.5.5.dist-info}/entry_points.txt +0 -1
- autopkg_wrapper-2024.5.2.dist-info/RECORD +0 -13
- {autopkg_wrapper-2024.5.2.dist-info → autopkg_wrapper-2024.5.5.dist-info}/LICENSE +0 -0
- {autopkg_wrapper-2024.5.2.dist-info → autopkg_wrapper-2024.5.5.dist-info}/WHEEL +0 -0
autopkg_wrapper/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "2024.5.
|
|
1
|
+
__version__ = "2024.5.5"
|
|
@@ -4,6 +4,7 @@ import logging
|
|
|
4
4
|
import plistlib
|
|
5
5
|
import subprocess
|
|
6
6
|
import sys
|
|
7
|
+
from datetime import datetime
|
|
7
8
|
from itertools import chain
|
|
8
9
|
from pathlib import Path
|
|
9
10
|
|
|
@@ -85,7 +86,12 @@ class Recipe(object):
|
|
|
85
86
|
self.results["failed"] = True
|
|
86
87
|
self.results["imported"] = ""
|
|
87
88
|
else:
|
|
88
|
-
|
|
89
|
+
report_dir = Path("/tmp/autopkg")
|
|
90
|
+
report_time = datetime.now().strftime("%Y-%m-%dT%H-%M-%S")
|
|
91
|
+
report_name = Path(f"{self.name}-{report_time}.plist")
|
|
92
|
+
|
|
93
|
+
report_dir.mkdir(parents=True, exist_ok=True)
|
|
94
|
+
report = report_dir / report_name
|
|
89
95
|
report.touch(exist_ok=True)
|
|
90
96
|
|
|
91
97
|
try:
|
|
@@ -195,21 +201,23 @@ def parse_recipe_list(recipes, recipe_file, post_processors):
|
|
|
195
201
|
logging.info(f"Recipes: {recipes}") if recipes else None
|
|
196
202
|
logging.info(f"Recipe List: {recipe_file}") if recipe_file else None
|
|
197
203
|
|
|
198
|
-
if recipe_file
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
204
|
+
if recipe_file:
|
|
205
|
+
if recipe_file.suffix == ".json":
|
|
206
|
+
with open(recipe_file, "r") as f:
|
|
207
|
+
recipe_list = json.load(f)
|
|
208
|
+
elif recipe_file.suffix == ".txt":
|
|
209
|
+
with open(recipe_file, "r") as f:
|
|
210
|
+
recipe_list = f.read().splitlines()
|
|
211
|
+
if recipes:
|
|
212
|
+
if isinstance(recipes, list):
|
|
213
|
+
recipe_list = recipes
|
|
214
|
+
elif isinstance(recipes, str):
|
|
215
|
+
if recipes.find(",") != -1:
|
|
216
|
+
# Assuming recipes separated by commas
|
|
217
|
+
recipe_list = [recipe.strip() for recipe in recipes.split(",") if recipe]
|
|
218
|
+
else:
|
|
219
|
+
# Assuming recipes separated by space
|
|
220
|
+
recipe_list = [recipe.strip() for recipe in recipes.split(" ") if recipe]
|
|
213
221
|
|
|
214
222
|
if recipe_list is None:
|
|
215
223
|
logging.error(
|
autopkg_wrapper/utils/args.py
CHANGED
|
@@ -24,6 +24,14 @@ def validate_directory(arg):
|
|
|
24
24
|
message = f"Error! This is not valid directory: {arg}"
|
|
25
25
|
raise argparse.ArgumentTypeError(message)
|
|
26
26
|
|
|
27
|
+
def validate_bool(arg):
|
|
28
|
+
if isinstance(arg, bool):
|
|
29
|
+
return arg
|
|
30
|
+
elif isinstance(arg, str) and arg.lower() in ['0','false','no', 'f']:
|
|
31
|
+
return False
|
|
32
|
+
elif isinstance(arg, str) and arg.lower() in ['1','true','yes', 't']:
|
|
33
|
+
return True
|
|
34
|
+
|
|
27
35
|
def setup_args():
|
|
28
36
|
parser = argparse.ArgumentParser(description="Run autopkg recipes")
|
|
29
37
|
recipe_arguments = parser.add_mutually_exclusive_group()
|
|
@@ -50,7 +58,7 @@ def setup_args():
|
|
|
50
58
|
)
|
|
51
59
|
parser.add_argument(
|
|
52
60
|
"--debug",
|
|
53
|
-
default=os.getenv("AW_DEBUG", False),
|
|
61
|
+
default=validate_bool(os.getenv("AW_DEBUG", False)),
|
|
54
62
|
action="store_true",
|
|
55
63
|
help="Enable debug logging when running script",
|
|
56
64
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: autopkg-wrapper
|
|
3
|
-
Version: 2024.5.
|
|
3
|
+
Version: 2024.5.5
|
|
4
4
|
Summary: A package used to execute some autopkg functions, primarily within the context of a GitHub Actions runner.
|
|
5
5
|
Home-page: https://github.com/smithjw/autopkg-wrapper
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -10,13 +10,13 @@ Requires-Python: >=3.12,<4.0
|
|
|
10
10
|
Classifier: License :: OSI Approved :: BSD License
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
-
Requires-Dist: chardet (
|
|
14
|
-
Requires-Dist: idna (
|
|
15
|
-
Requires-Dist: pygithub (
|
|
16
|
-
Requires-Dist: requests (
|
|
17
|
-
Requires-Dist: ruamel-yaml (
|
|
18
|
-
Requires-Dist: toml (
|
|
19
|
-
Requires-Dist: urllib3 (
|
|
13
|
+
Requires-Dist: chardet (>=5)
|
|
14
|
+
Requires-Dist: idna (>=3)
|
|
15
|
+
Requires-Dist: pygithub (>=2)
|
|
16
|
+
Requires-Dist: requests (>=2)
|
|
17
|
+
Requires-Dist: ruamel-yaml (>=0.18)
|
|
18
|
+
Requires-Dist: toml (>=0.10)
|
|
19
|
+
Requires-Dist: urllib3 (>=2)
|
|
20
20
|
Project-URL: Repository, https://github.com/smithjw/autopkg-wrapper
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
22
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
autopkg_wrapper/__init__.py,sha256=RCuWJ5-a3SXGyEdES2_N0Fs8WUMH8jk3cU1m6Priifg,25
|
|
2
|
+
autopkg_wrapper/autopkg_wrapper.py,sha256=9t3d58w24P2yU3jZGsmO_hjPK4vFlW4meJ_hBuHgcuo,10940
|
|
3
|
+
autopkg_wrapper/notifier/__init__.py,sha256=ShXQBVjyiSOHxoQJS2BvNG395W4KZfqMxZWBAR0MZrE,22
|
|
4
|
+
autopkg_wrapper/notifier/slack.py,sha256=nKHeSmgDaTaSUo19ZgnjjjKzeWgg34fMHUwNj9C5FMY,1982
|
|
5
|
+
autopkg_wrapper/utils/__init__.py,sha256=ShXQBVjyiSOHxoQJS2BvNG395W4KZfqMxZWBAR0MZrE,22
|
|
6
|
+
autopkg_wrapper/utils/args.py,sha256=RW7h5hx6cXfAjXn-Q2w5PRjLHMV8A5vcSWJD_Zjg_2Y,4212
|
|
7
|
+
autopkg_wrapper/utils/git_functions.py,sha256=zMMzwRG9V2VFaQk3y_o1H63_hzI1qohwBKaetNDS2mY,2975
|
|
8
|
+
autopkg_wrapper/utils/logging.py,sha256=3knpMViO_zAU8WM5bSImQaz5M01vMFk_raB4lt1cbvo,324
|
|
9
|
+
autopkg_wrapper-2024.5.5.dist-info/LICENSE,sha256=PpNOQjZGcsKFuA0wU16YU7PueVxqPX4OnyZ7TlLQlq4,1602
|
|
10
|
+
autopkg_wrapper-2024.5.5.dist-info/METADATA,sha256=x3Uq7b1GSTqCbGBGurjee8wjgHk5ObxOyNLqBMdhA5E,2636
|
|
11
|
+
autopkg_wrapper-2024.5.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
12
|
+
autopkg_wrapper-2024.5.5.dist-info/entry_points.txt,sha256=-whajEGfgetm2CroLN1IMolYlyM9QqUPM7oJZWQrVfE,72
|
|
13
|
+
autopkg_wrapper-2024.5.5.dist-info/RECORD,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
autopkg_wrapper/__init__.py,sha256=GutD5USPa0NhGX5YEeFCEZazyKDHf2SZrqhbbnLzpM4,25
|
|
2
|
-
autopkg_wrapper/autopkg_wrapper.py,sha256=O0WyIuiKbKUYq9dpXNczh6lCzqDAubeH70Bw6-wKEUg,10575
|
|
3
|
-
autopkg_wrapper/notifier/__init__.py,sha256=ShXQBVjyiSOHxoQJS2BvNG395W4KZfqMxZWBAR0MZrE,22
|
|
4
|
-
autopkg_wrapper/notifier/slack.py,sha256=nKHeSmgDaTaSUo19ZgnjjjKzeWgg34fMHUwNj9C5FMY,1982
|
|
5
|
-
autopkg_wrapper/utils/__init__.py,sha256=ShXQBVjyiSOHxoQJS2BvNG395W4KZfqMxZWBAR0MZrE,22
|
|
6
|
-
autopkg_wrapper/utils/args.py,sha256=BGbskLzeBeq7ae0Vp1XuoAD5gqKGILOTaNUHvo2DhNY,3934
|
|
7
|
-
autopkg_wrapper/utils/git_functions.py,sha256=zMMzwRG9V2VFaQk3y_o1H63_hzI1qohwBKaetNDS2mY,2975
|
|
8
|
-
autopkg_wrapper/utils/logging.py,sha256=3knpMViO_zAU8WM5bSImQaz5M01vMFk_raB4lt1cbvo,324
|
|
9
|
-
autopkg_wrapper-2024.5.2.dist-info/LICENSE,sha256=PpNOQjZGcsKFuA0wU16YU7PueVxqPX4OnyZ7TlLQlq4,1602
|
|
10
|
-
autopkg_wrapper-2024.5.2.dist-info/METADATA,sha256=JzCjCf0xMpDT07HKQU5CbbJewVLhgfVo2lL3Q0FuS7k,2659
|
|
11
|
-
autopkg_wrapper-2024.5.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
12
|
-
autopkg_wrapper-2024.5.2.dist-info/entry_points.txt,sha256=w9VfrX4aY0ZzJndvzjSI5lLe_sCP2tIq0I5bRLlEKJc,125
|
|
13
|
-
autopkg_wrapper-2024.5.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|