Skip to content

Add yaml-based package file

Benjamin Winger requested to merge bmwinger/portmod:yaml_format into master

Fixes #395 (closed).

Variables such as P, PV, PN (as provided by pybuild.info) can be used via string.Template substitutions. It may be worthwhile to include variables like T, FILESDIR, D and WORKDIR in the substitutions. These won't have a value except during installation, but since we're using safe_substitute all that means is that the placeholder will appear in the output. Unfortunately, this syntax is different from yaml's builtin anchors, however anchors also can't be used for string substitutions (like using P in the download URL); they're designed for de-duplicating more complex structures.

It could also be possible to allow substitutions of top-level string values by parsing the file twice, the first time to find the top-level strings to substitute, and the second time to substitute them everywhere else. It might require multiple substitutions to converge, and there could also be loops.

Alternatively, we might be able to offload substitutions to a templating engine, but that seems like overkill, and most templating engines aren't aware of the data file structure anyway (there are some, but it still starts getting very complicated for a system that is supposed to be simple).

Merge request reports