diff --git a/pungi.spec b/pungi.spec index 6c4e2652..85e4e318 100644 --- a/pungi.spec +++ b/pungi.spec @@ -2,7 +2,7 @@ Name: pungi Version: 4.3.7 -Release: 5%{?dist}.alma +Release: 6%{?dist}.alma Summary: Distribution compose tool License: GPL-2.0-only @@ -159,6 +159,9 @@ rm %{buildroot}%{_bindir}/pungi %changelog +* Thu Apr 13 2023 Stepan Oksanichenko - 4.3.7-6 +- CLI option `--label` can be passed through a Pungi config file + * Fri Mar 31 2023 Stepan Oksanichenko - 4.3.7-4 - ALBS-1030: Generate Devel section in packages.json - Also the tool can combine (remove and add) packages in a variant from different sources according to an url's type of source diff --git a/pungi/checks.py b/pungi/checks.py index 693aad3c..5d11fb7b 100644 --- a/pungi/checks.py +++ b/pungi/checks.py @@ -610,6 +610,7 @@ def make_schema(): "release_discinfo_description": {"type": "string"}, "treeinfo_version": {"type": "string"}, "compose_type": {"type": "string", "enum": COMPOSE_TYPES}, + "label": {"type": "string"}, "base_product_name": {"type": "string"}, "base_product_short": {"type": "string"}, "base_product_version": {"type": "string"}, diff --git a/pungi/scripts/pungi_koji.py b/pungi/scripts/pungi_koji.py index 97db2263..aefbd60c 100644 --- a/pungi/scripts/pungi_koji.py +++ b/pungi/scripts/pungi_koji.py @@ -233,16 +233,9 @@ def main(): latest_link_status = opts.latest_link_status or None latest_link_components = opts.latest_link_components - import kobo.conf import kobo.log import productmd.composeinfo - if opts.label: - try: - productmd.composeinfo.verify_label(opts.label) - except ValueError as ex: - abort(str(ex)) - from pungi.compose import Compose logger = logging.getLogger("pungi") @@ -251,9 +244,15 @@ def main(): kobo.log.add_stderr_logger(logger) conf = util.load_config(opts.config) - compose_type = opts.compose_type or conf.get("compose_type", "production") - if compose_type == "production" and not opts.label and not opts.no_label: + label = opts.label or conf.get("label") + if label: + try: + productmd.composeinfo.verify_label(label) + except ValueError as ex: + abort(str(ex)) + + if compose_type == "production" and not label and not opts.no_label: abort("must specify label for a production compose") if ( @@ -300,7 +299,10 @@ def main(): if opts.target_dir: compose_dir = Compose.get_compose_dir( - opts.target_dir, conf, compose_type=compose_type, compose_label=opts.label + opts.target_dir, + conf, + compose_type=compose_type, + compose_label=label ) else: compose_dir = opts.compose_dir @@ -309,7 +311,7 @@ def main(): ci = Compose.get_compose_info( conf, compose_type=compose_type, - compose_label=opts.label, + compose_label=label, parent_compose_ids=opts.parent_compose_id, respin_of=opts.respin_of, )