1MODULEMD-ADD-PLATFORM(1)         User Commands        MODULEMD-ADD-PLATFORM(1)
2
3
4

NAME

6       modulemd-add-platform  -  add a context for a new platform to modulemd-
7       packager document
8

SYNOPSIS

10       modulemd-add-platform [--debug] --old PLATFORM --new PLATFORM
11                             [--stdout] [--skip] FILE
12       modulemd-add-platform {-h|--help}
13

DESCRIPTION

15       This  tool adds a new context configuration to a modulemd-packager YAML
16       file.  The file defines how to build a module.
17
18       The tool loads a  FILE,  locates  all  context  configurations  with  a
19       plaform equivalent to the --old argument, duplicates the configurations
20       under new context identifiers, and replaces there the platforms with  a
21       new  one specified in --new argument. If a context for the new platform
22       already exists, the file will be kept unchanged.
23
24       As the new context identifier is used the new platform value.  If  such
25       context  already exists, a new, unique, small decimal number (e.g. "0",
26       "1") will be used.
27
28       This tool aims to preserve a physical representation of the YAML files.
29       That  includes  white  spaces,  comments,  and quoting styles. Also all
30       fields of the configuration, like buildrequires, or buildopts  will  be
31       preserved.
32
33       Finally, the the new content is validated and if no damage is detected,
34       the content is saved back to the FILE. Users are advised to  check  the
35       changes before commiting to them.
36

OPTIONS

38       --old PLATFORM
39              Use  context  configurations  of this old PLATFORM as a template
40              for addition. This option is mandatory.
41
42       --new PLATFORM
43              Set this PLATFORM in the  new  configurations.  This  option  is
44              mandatory.
45
46       --skip If  specified, the files without a context configuration for the
47              old platform and files of modulemd-v2 format  will  be  ignored.
48              Otherwise, an error is reported.
49
50       --stdout
51              The edited document will be printed to a standard output instead
52              of rewriting the FILE in place.
53
54       --debug
55              Print various debugging messages about parsing and  editing  the
56              YAML files to an error output.
57
58       -h, --help
59              Show a usage text and exit without processing any files.
60

EXAMPLE

62       Let's have a file /tmp/test.yaml:
63
64              document: modulemd-packager
65              version: 3
66              data:
67                  configurations:
68                  - context: 'A'
69                    platform: f34
70
71       Adding  a  configuration  for  platform:f35  can  be achieved with mod‐
72       ulemd-add-platform --old f34 --new f35 /tmp/test.yaml command.  The re‐
73       sulting file will be:
74
75              document: modulemd-packager
76              version: 3
77              data:
78                  configurations:
79                  - context: 'A'
80                    platform: f34
81                  - context: 'f35'
82                    platform: f35
83

EXIT CODE

85       Return a zero exit code if the FILE was successfully edited or the FILE
86       already contained the new platform.
87
88       Return non-zero exit code if an error occurred.
89
90       If the input FILE does not contain a context for the old  platform,  or
91       if the file is modulemd-v2 document, which does not use context config‐
92       urations, the behaviour depends on a use of --skip option. If it  isn't
93       used,  a  non-zero  code will be returned. Otherwise, zero code will be
94       returned.
95

REPORTING BUGS

97       Bugs and feature requests can be reported at  the  modulemd-tools  home
98       page ⟨https://github.com/rpm-software-management/modulemd-tools⟩.
99

SEE ALSO

101       Specification  of  the modulemd-packager documents is available among a
102       documentation for libmodulemd package or in yaml_spec directory at  the
103       libmodulemd         home        page        ⟨https://github.com/fedora-
104       modularity/libmodulemd⟩.
105
106
107
108modulemd-tools                                        MODULEMD-ADD-PLATFORM(1)
Impressum