diff --git a/doc/configuration.rst b/doc/configuration.rst index 58683dc6..b965912b 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -544,6 +544,8 @@ Options * ``add_template_var`` -- *[str]* (default empty) * ``add_arch_template_var`` -- *[str]* (default empty) * ``rootfs_size`` -- [*int*] (default empty) + * ``version`` -- [*str*] (default from ``release_version``) -- used as + ``--version`` and ``--release`` argument on the lorax command line **lorax_extra_sources** (*list*) -- a variant/arch mapping with urls for extra source repositories added to Lorax command line. Either one repo or a list can be specified. diff --git a/pungi/checks.py b/pungi/checks.py index 65a3922c..66b8c000 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -1178,6 +1178,7 @@ def make_schema(): 'add_template_var': {"$ref": "#/definitions/list_of_strings"}, 'add_arch_template_var': {"$ref": "#/definitions/list_of_strings"}, "rootfs_size": {"type": "integer"}, + "version": {"type": "string"}, }, "additionalProperties": False, }), diff --git a/pungi/phases/buildinstall.py b/pungi/phases/buildinstall.py index dfa0bda9..9e26088b 100644 --- a/pungi/phases/buildinstall.py +++ b/pungi/phases/buildinstall.py @@ -70,6 +70,7 @@ class BuildinstallPhase(PhaseBase): add_template_var = [] add_arch_template_var = [] rootfs_size = None + version = self.compose.conf["release_version"] for data in get_arch_variant_data(self.compose.conf, 'lorax_options', arch, variant): if not data.get('noupgrade', True): noupgrade = False @@ -83,6 +84,8 @@ class BuildinstallPhase(PhaseBase): add_arch_template.extend(data.get('add_arch_template', [])) add_template_var.extend(data.get('add_template_var', [])) add_arch_template_var.extend(data.get('add_arch_template_var', [])) + if "version" in data: + version = data["version"] output_dir = os.path.join(output_dir, variant.uid) output_topdir = output_dir @@ -112,8 +115,8 @@ class BuildinstallPhase(PhaseBase): lorax = LoraxWrapper() lorax_cmd = lorax.get_lorax_cmd(self.compose.conf["release_name"], - self.compose.conf["release_version"], - self.compose.conf["release_version"], + version, + version, repos, output_dir, variant=variant.uid, diff --git a/tests/test_buildinstall.py b/tests/test_buildinstall.py index cfdc3666..176bfb1b 100644 --- a/tests/test_buildinstall.py +++ b/tests/test_buildinstall.py @@ -260,6 +260,7 @@ class TestBuildinstallPhase(PungiTestCase): 'add_template_var': ['baz=1'], 'add_arch_template_var': ['quux=2'], "rootfs_size": 3, + "version": "1.2.3", }, 'amd64': {'noupgrade': False} }), @@ -290,7 +291,7 @@ class TestBuildinstallPhase(PungiTestCase): # Obtained correct lorax commands. self.assertItemsEqual( loraxCls.return_value.get_lorax_cmd.mock_calls, - [mock.call('Test', '1', '1', + [mock.call('Test', '1.2.3', '1.2.3', [self.topdir + '/work/x86_64/repo', self.topdir + '/work/x86_64/comps_repo_Server'], self.topdir + '/work/x86_64/buildinstall/Server',