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
528 stars 52 forks source link

YAML formatted recipes not showing in AutoPkgr #672

Closed beatlemike closed 2 years ago

beatlemike commented 2 years ago

When recipes are formatted in YAML, these may be because of the file naming ".yaml", they do not show in autopkg recipe repos,

homebysix commented 2 years ago

Regarding the .yaml file extension requirement added in AutoPkg 1.3.0, be sure to monitor this discussion: https://github.com/autopkg/autopkg/issues/767

magnusviri commented 2 years ago

Something needs to be done about this. I don't often update my repos but I just did and now I don't have Graham Pugh's PyMOL recipe shown in AutoPkgr because he switched to yaml. I know this is blocked on AutoPkgr parsing the yaml files. Can it just skip the parsing and leave the info it gets from parsing empty?

shawnhonsberger commented 2 years ago

Hi @magnusviri. There's not a way to skip the parsing because there is not a way to interpret such data that would require the skip. Also, AutoPkgr relies on parsing to build the objects and contents that display.

shawnhonsberger commented 2 years ago

Hi everyone. Due to the fact that there is no native YAML library for macOS, AutoPkgr does not support .yaml recipes and they will not display in the recipe list. However, AutoPkgr will be able to run any recipe you like via your recipe list (even if those recipes are .yaml and are added to your recipe list manually, or have parent recipes that are .yaml). AutoPkgr's recipe list is stored at ~/Library/Application Support/AutoPkgr/recipe_list.txt and can be edited with any text editor.

jelockwood commented 1 year ago

@shawnhonsberger I tried adding a YAML recipe to my recipe_list and it did not work - in that it was not shown in AutoPkgr afterwards even after relaunching AutoPkgr. I even tried using the autopkg command line to generate an override for a YAML recipe and that also was not accepted by AutoPkgr even thought the override was in plist format.

It should be noted that if you have a chain of recipes like the following -

download.recipe.yaml pkg.recipe.yaml munki.recipe.yaml

then ONLY the munki one has to be in plist format for AutoPkgr to accept the whole chain. It will warn the parent recipes are 'missing' because it cannot 'see' YAML recipes but it will execute the munki recipe in plist format which will tell AutoPkg the parent YAML identifier and AutoPkg will find it and run that.

Note: AutoPkgr will then also let you generate an override for the munki plist recipe even if the parents are in YAML format.

I use https://wtools.io/convert-yaml-to-plist to convert YAML recipes to plist format.

As Python is installed on a Mac that is using autopkg (it comes as part of the autopkg installation) an option for you to look at is the fact that you might be able to use a python script to process YAML files.

See - https://github.com/grahampugh/plist-yaml-plist as an example.