MODULEMD-ADD-PLATFORM(1)
π MODULEMD-ADD-PLATFORM π
okay bestie, so this is a User Command, section 1 of the manual, and it's literally called modulemd-add-platform. It's a lil tool from the modulemd-tools fam and it's here to help you β¨manifestβ¨ a whole new platform into your module build config. Let's get into it π«Ά
β¨ NAME β¨
modulemd-add-platform β adds a context for a new platform to a modulemd-packager document. yes queen, that's the whole job π
πΈ SYNOPSIS πΈ
modulemd-add-platform [--debug] --old PLATFORM --new PLATFORM [--stdout]
[--skip] FILE
modulemd-add-platform {-h|--help}
π¦ DESCRIPTION π¦
So here's the tea: this tool adds a new context configuration to a modulemd-packager YAML file. And that file? It's the one that defines how to build a module. main character document energy, no cap π
What it actually does, step by step, fr fr:
- It loads a FILE.
- It hunts down all the context configurations whose platform is equivalent to whatever you passed to
--old. - It duplicates those configurations under new context identifiers.
- Then it swaps the platforms in them out for the new one you gave it in
--new.
And if a context for the new platform is already sitting there? The file stays exactly as it was. untouched. we're not touching it. π
About that new context identifier β the tool uses the new platform value as the identifier. But if a context with that name already exists, it'll go with a new, unique, small decimal number instead, like "0", "1". cute, tiny, numbered. iconic honestly π
Now, the part that's lowkey the most thoughtful: this tool aims to preserve a physical representation of the YAML files. That means:
- white spaces π«§
- comments π¬
- quoting styles β¨
all preserved. And not just the vibes β all fields of the configuration get preserved too, like buildrequires, or buildopts. nothing gets dropped, periodt.
Finally, the new content gets validated, and if no damage is detected, the content is saved back to the FILE.
β οΈ Bestie, please β users are advised to check the changes before committing to them. Read your diff. It's giving responsible. π
π OPTIONS π
--old PLATFORMβ Use the context configurations of this old PLATFORM as a template for the addition. This one is mandatory, so no skipping it, babe.--new PLATFORMβ Set this PLATFORM in the new configurations. Also mandatory. Two mandatory options, we love a firm boundary.--skipβ If you specify this, then files without a context configuration for the old platform, and files in themodulemd-v2format, will just be ignored. If you don't use it, you get an error reported instead. choose your fighter π₯--stdoutβ The edited document gets printed to standard output instead of rewriting the FILE in place. for the girlies who like to preview before they commit π--debugβ Prints various debugging messages about parsing and editing the YAML files to an error output. yap mode: activated π₯-h,--helpβ Shows a usage text and exits without processing any files. the classic escape hatch π§
π EXAMPLE π
Let's say you have a file at /tmp/test.yaml that looks like this:
document: modulemd-packager
version: 3
data:
configurations:
- context: 'A'
platform: f34
Now you wanna add a configuration for platform:f35. You do it with this command:
modulemd-add-platform --old f34 --new f35 /tmp/test.yaml
And boom, the resulting file will be:
document: modulemd-packager
version: 3
data:
configurations:
- context: 'A'
platform: f34
- context: 'f35'
platform: f35
look at that. a whole new context. we ate and left no crumbs π
β EXIT CODE β
- Returns a zero exit code if the FILE was successfully edited, or if the FILE already contained the new platform. slay β
- Returns a non-zero exit code if an error occurred. π
And here's the spicy bit: if the input FILE does not contain a context for the old platform, or if the file is a modulemd-v2 document (which doesn't use context configurations at all), then the behaviour depends on whether you used the --skip option.
- If
--skipisn't used β a non-zero code will be returned. - If
--skipis used β zero code will be returned.
so basically --skip is your "it's fine, we move on" button π«Ά
π REPORTING BUGS π
Found a bug? Got a feature request? Don't suffer in silence, bestie β bugs and feature requests can be reported at the modulemd-tools home page. they want to hear from you fr fr π
π SEE ALSO π
The specification of the modulemd-packager documents is available among the documentation for the libmodulemd package, or in the yaml_spec directory at the libmodulemd home page. go read it, iykyk πβ¨
okay that's the whole page!! mwah π this came from modulemd-tools, and yeah, it's the MODULEMD-ADD-PLATFORM(1) manual page β you're welcome, go add some platforms and stay hydrated π§ββοΈπΈ
π¦ where this page comes from
- epel 10: modulemd-tools 0.16-13.el10_2 Β· MIT
- fedora 43: modulemd-tools 0.16-13.fc43 Β· MIT
- fedora 44: modulemd-tools 0.16-14.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms