lindegroup / autopkgr

AutoPkgr is a free Mac app that makes it easy to install and configure AutoPkg.
http://www.lindegroup.com/autopkgr
Apache License 2.0
538 stars 51 forks source link

Recipe List using Identifier and not Filename #683

Closed Lotusshaney closed 2 years ago

Lotusshaney commented 2 years ago

The whole idea of overrides is that the have the same filename as the recipe they are overriding, so that you simply call the name and the override is used automatically.

Example : Make an override for AmazonCorettoJDK11.pkg.recipe and run autopkg info AmazonCorettoJDK11.pkg.recipe

autopkg info AmazonCorettoJDK11.pkg.recipe Description: Downloads the current release version of Amazon Coretto JDK 11 for macOS on Intel and renames the package. Identifier: local.pkg.AmazonCorettoJDK11 Munki import recipe: False Has check phase: True Builds package: False Recipe file path: /Users/autopkg/Library/AutoPkg/RecipeOverrides/AmazonCorettoJDK11.pkg.recipe Parent recipe(s): /Users/autopkg/Library/AutoPkg/RecipeRepos/com.github.autopkg.rtrouton-recipes/AmazonCorettoJDK11/AmazonCorettoJDK11.pkg.recipe /Users/autopkg/Library/AutoPkg/RecipeRepos/com.github.autopkg.rtrouton-recipes/AmazonCorettoJDK11/AmazonCorettoJDK11.download.recipe Input values: 'ARCHITECTURE': 'Intel', 'DISTRIBUTION': 'Coretto', 'NAME': 'Amazon Coretto JDK 11', 'SEARCH_PATTERN': '(?Phttps.?corretto.?\-macosx-x64.pkg)', 'SEARCH_URL': 'https://github.com/corretto/corretto-11/releases/latest', 'SOFTWARETITLE': 'Java', 'SOFTWARETYPE': 'JDK', 'VENDOR': 'Amazon'

and the file path is automatically the override.

However when autopkgr makes the recipe list it directly references the override by its identifier, so local.pkg.AmazonCorettoJDK11 in this case. Is this correct behaviour for autopkgr?

This can cause problems if your using the list on a machine that does not have or need the overrides as the recipe cannot be found.

shawnhonsberger commented 2 years ago

Thanks @Lotusshaney. Yes, this is the correct behavior for AutoPkgr. The identifier is added to the recipe list, and that identifier is used when the list is called during the run. If importing a recipe list from elsewhere, you will need to ensure that all the necessary repos are added, and then create overrides for any recipe overrides you plan to add to your recipe list. You could also import your recipe overrides from the same source as your imported recipe list, and update their trust info.

Lotusshaney commented 2 years ago

Thanks for the info, its a shame as Im not using Autopkgr to do the scheduled run, im using it to produce the recipe list for non Mac admin staff to use. I have a tool that runs through the Autopkgr recipe and converts it to the filename, but just wanted to check it was the expected behaviour.