- CLI option `--label` can be passed through a Pungi config file

- Bump version
- Update changelog
This commit is contained in:
soksanichenko 2023-04-13 00:57:39 +03:00
parent e55abb17f1
commit 1c3e5dce5e
3 changed files with 18 additions and 12 deletions

View File

@ -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 <soksanichenko@cloudlinux.com> - 4.3.7-6
- CLI option `--label` can be passed through a Pungi config file
* Fri Mar 31 2023 Stepan Oksanichenko <soksanichenko@cloudlinux.com> - 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

View File

@ -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"},

View File

@ -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,
)