From 746a641ef8b0265600dab717f3dd88fca2c41575 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 27 Jun 2018 12:28:53 -0700 Subject: [PATCH] Work around a DNF 3 bug that breaks repo setup (#1595917) --- ...-a-bug-with-config-values-that-are-l.patch | 38 +++++++++++++++++++ livecd-tools.spec | 9 ++++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 0001-DNF-3-workaround-a-bug-with-config-values-that-are-l.patch diff --git a/0001-DNF-3-workaround-a-bug-with-config-values-that-are-l.patch b/0001-DNF-3-workaround-a-bug-with-config-values-that-are-l.patch new file mode 100644 index 0000000..72093af --- /dev/null +++ b/0001-DNF-3-workaround-a-bug-with-config-values-that-are-l.patch @@ -0,0 +1,38 @@ +From 676b1e1261b442a80cdf2cbb96d192b1db02b894 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Wed, 27 Jun 2018 11:51:50 -0700 +Subject: [PATCH] DNF 3: workaround a bug with config values that are lists + +There's a bug / overly-clever-design flaw in DNF 3 that prevents +us appending to config values that appear to be lists, even +though lists should be mutable objects and this *ought* to work +(and did work in DNF 2): + +https://bugzilla.redhat.com/show_bug.cgi?id=1595917 + +This works around it. + +Signed-off-by: Adam Williamson +--- + imgcreate/dnfinst.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/imgcreate/dnfinst.py b/imgcreate/dnfinst.py +index 8e28f34..a81f04b 100644 +--- a/imgcreate/dnfinst.py ++++ b/imgcreate/dnfinst.py +@@ -179,7 +179,10 @@ class DnfLiveCD(dnf.Base): + # dnf 1 + repo = dnf.repo.Repo(name, cachedir = self.conf.cachedir) + if url: +- repo.baseurl.append(_varSubstitute(url)) ++ # some overly clever trickery in dnf 3 prevents us just ++ # using repo.baseurl.append here: ++ # https://bugzilla.redhat.com/show_bug.cgi?id=1595917 ++ repo.baseurl = repo.baseurl + [_varSubstitute(url)] + if mirrorlist: + repo.mirrorlist = _varSubstitute(mirrorlist) + repo.enable() +-- +2.18.0.rc2 + diff --git a/livecd-tools.spec b/livecd-tools.spec index b9810ff..4fc369e 100644 --- a/livecd-tools.spec +++ b/livecd-tools.spec @@ -10,7 +10,7 @@ Summary: Tools for building live CDs Name: livecd-tools Version: 25.0 -Release: 7%{?dist} +Release: 8%{?dist} Epoch: 1 License: GPLv2 Group: System Environment/Base @@ -19,6 +19,10 @@ Source0: https://releases.pagure.org/%{name}/%{name}-%{version}.tar.gz Patch0: https://github.com/livecd-tools/livecd-tools/commit/491a49ff9aedf5197af3e4dcb0f50351db3cddf0.patch Patch1: livecd-tools-revert-restorecon.patch +# Workaround an issue in DNF 3: +# https://bugzilla.redhat.com/show_bug.cgi?id=1595917 +# https://github.com/weldr/lorax/pull/388 +Patch2: 0001-DNF-3-workaround-a-bug-with-config-values-that-are-l.patch BuildRequires: python2-devel %if %{with python3} @@ -190,6 +194,9 @@ rm -rfv %{buildroot}%{_mandir}/man8/livecd-iso-to-* %endif %changelog +* Wed Jun 27 2018 Adam Williamson - 1:25.0-8 +- Work around a DNF 3 bug that breaks repo setup (#1595917) + * Tue Jun 19 2018 Miro HronĨok - 1:25.0-7 - Rebuilt for Python 3.7