autopkg-wrapper 2024.5.1__tar.gz → 2024.5.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: autopkg-wrapper
3
- Version: 2024.5.1
3
+ Version: 2024.5.2
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
@@ -0,0 +1 @@
1
+ __version__ = "2024.5.2"
@@ -32,8 +32,10 @@ class Recipe(object):
32
32
 
33
33
  return name
34
34
 
35
- def verify_trust_info(self):
36
- cmd = ["/usr/local/bin/autopkg", "verify-trust-info", self.filename, "-v"]
35
+ def verify_trust_info(self, debug):
36
+ verbose_output = ["-vvvv"]
37
+ cmd = ["/usr/local/bin/autopkg", "verify-trust-info", self.filename]
38
+ cmd = cmd + verbose_output if debug else cmd
37
39
  cmd = " ".join(cmd)
38
40
  logging.debug(f"cmd: {str(cmd)}")
39
41
 
@@ -77,7 +79,7 @@ class Recipe(object):
77
79
 
78
80
  return {"imported": imported_items, "failed": failed_items}
79
81
 
80
- def run(self):
82
+ def run(self, debug):
81
83
  if self.verified is False:
82
84
  self.error = True
83
85
  self.results["failed"] = True
@@ -88,15 +90,16 @@ class Recipe(object):
88
90
 
89
91
  try:
90
92
  post_processor_cmd = list(chain.from_iterable([("--post", processor) for processor in self.post_processors])) if self.post_processors else None
91
- initial_cmd = [
93
+ verbose_output = ["-vvvv"]
94
+ cmd = [
92
95
  "/usr/local/bin/autopkg",
93
96
  "run",
94
97
  self.filename,
95
- "-v",
96
98
  "--report-plist",
97
99
  str(report),
98
100
  ]
99
- cmd = initial_cmd + post_processor_cmd if post_processor_cmd else initial_cmd
101
+ cmd = cmd + post_processor_cmd if post_processor_cmd else cmd
102
+ cmd = cmd + verbose_output if debug else cmd
100
103
  cmd = " ".join(cmd)
101
104
 
102
105
  logging.debug(f"cmd: {str(cmd)}")
@@ -245,21 +248,21 @@ def parse_post_processors(post_processors):
245
248
  return post_processors_list
246
249
 
247
250
 
248
- def process_recipe(recipe, disable_recipe_trust_check):
251
+ def process_recipe(recipe, disable_recipe_trust_check, debug):
249
252
  if disable_recipe_trust_check:
250
253
  logging.debug("Setting Recipe verification to None")
251
254
  recipe.verified = None
252
255
  else:
253
256
  logging.debug("Checking Recipe verification")
254
- recipe.verify_trust_info()
257
+ recipe.verify_trust_info(debug)
255
258
 
256
259
  match recipe.verified:
257
260
  case False | None if disable_recipe_trust_check:
258
261
  logging.debug("Running Recipe without verification")
259
- recipe.run()
262
+ recipe.run(debug)
260
263
  case True:
261
264
  logging.debug("Running Recipe after successful verification")
262
- recipe.run()
265
+ recipe.run(debug)
263
266
  case False:
264
267
  recipe.update_trust_info()
265
268
 
@@ -267,7 +270,6 @@ def process_recipe(recipe, disable_recipe_trust_check):
267
270
 
268
271
 
269
272
  def main():
270
- print("Hello World")
271
273
  args = setup_args()
272
274
  setup_logger(args.debug if args.debug else False)
273
275
  logging.info("Running autopkg_wrapper")
@@ -279,7 +281,7 @@ def main():
279
281
 
280
282
  for recipe in recipe_list:
281
283
  logging.info(f"Processing Recipe: {recipe.name}")
282
- process_recipe(recipe=recipe, disable_recipe_trust_check=args.disable_recipe_trust_check)
284
+ process_recipe(recipe=recipe, disable_recipe_trust_check=args.disable_recipe_trust_check, debug=args.debug)
283
285
  update_recipe_repo(git_info=override_repo_info, recipe=recipe, disable_recipe_trust_check=args.disable_recipe_trust_check, args=args)
284
286
  slack.send_notification(recipe=recipe, token=args.slack_token) if args.slack_token else None
285
287
 
@@ -5,7 +5,7 @@
5
5
  name = "autopkg-wrapper"
6
6
  readme = "README.md"
7
7
  repository = "https://github.com/smithjw/autopkg-wrapper"
8
- version = "2024.5.1"
8
+ version = "2024.5.2"
9
9
 
10
10
  [tool.poetry.scripts]
11
11
  # When built and installed by pip, the command autopkg_wrapper will be availble in to run within that environment
@@ -1 +0,0 @@
1
- __version__ = "2024.5.1"