diff --git a/0001-ostree-Send-correct-ref-in-the-message.patch b/0001-ostree-Send-correct-ref-in-the-message.patch new file mode 100644 index 00000000..be58ea16 --- /dev/null +++ b/0001-ostree-Send-correct-ref-in-the-message.patch @@ -0,0 +1,43 @@ +From 5f6dcb37f69734229ce2e94528139640c46583aa Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Wed, 5 Dec 2018 11:20:17 +0100 +Subject: [PATCH] ostree: Send correct ref in the message +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If configuration requests a different ref than what treefile has, a +wrong message can be sent. + +If the treefile is in JSON, the local copy will be updated in-place and +it works. However with YAML the updated version is still written as JSON +and thus we are still sending the original value. + +Fixes: https://pagure.io/pungi/issue/1092 +Signed-off-by: Lubomír Sedlář +--- + pungi/phases/ostree.py | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/pungi/phases/ostree.py b/pungi/phases/ostree.py +index ae8505ac..8bbe4434 100644 +--- a/pungi/phases/ostree.py ++++ b/pungi/phases/ostree.py +@@ -93,8 +93,12 @@ class OSTreeThread(WorkerThread): + extra_config_file=extra_config_file) + + if compose.notifier: +- ref = get_ref_from_treefile(os.path.join(repodir, config['treefile']), +- arch, logger=self.pool._logger) ++ original_ref = get_ref_from_treefile( ++ os.path.join(repodir, config["treefile"]), ++ arch, ++ logger=self.pool._logger, ++ ) ++ ref = config.get("ostree_ref") or original_ref + # 'pungi-make-ostree tree' writes commitid to commitid.log in + # logdir, except if there was no new commit we will get None + # instead. If the commit id could not be read, an exception will be +-- +2.17.2 + diff --git a/pungi.spec b/pungi.spec index ce37a906..c61ad4bb 100644 --- a/pungi.spec +++ b/pungi.spec @@ -1,12 +1,13 @@ Name: pungi Version: 4.1.31 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 +Patch0: 0001-ostree-Send-correct-ref-in-the-message.patch BuildRequires: python3-nose BuildRequires: python3-mock @@ -193,6 +194,9 @@ nosetests-3 --exe %{_bindir}/%{name}-wait-for-signed-ostree-handler %changelog +* Wed Dec 05 2018 Lubomír Sedlář - 4.1.31-2 +- Send correct ostree ref to fedmsg + * Mon Nov 26 2018 Lubomír Sedlář - 4.1.31-1 - Remove patches keeping old ostree phase ordering - Add script to merge and dump multiple configuration files (lsedlar)