Backport further fix for #1595917

This commit is contained in:
Adam Williamson 2018-09-26 19:46:28 -07:00
parent 195162345a
commit 97d11f5bb9
2 changed files with 46 additions and 2 deletions

View File

@ -0,0 +1,38 @@
From 4354448197beb7c3d68c2bfc0d50d22b25822564 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Wed, 26 Sep 2018 18:30:01 -0700
Subject: [PATCH] Handle dnf config option showing as tuple, not list, in DNF
3.6
See https://bugzilla.redhat.com/show_bug.cgi?id=1595917 again.
This is a follow-up to 2cbd239 - after I reported the bug,
upstream changed in DNF 3.6 to present these values as tuples
rather than lists, to indicate that they cannot be mutated. So
we can't add a list to the retrieved value, like we did before,
but using += (tuple) like this seems to work both in DNF 3.6
and in older DNFs.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
imgcreate/dnfinst.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/imgcreate/dnfinst.py b/imgcreate/dnfinst.py
index a81f04b..720dd7d 100644
--- a/imgcreate/dnfinst.py
+++ b/imgcreate/dnfinst.py
@@ -182,7 +182,10 @@ class DnfLiveCD(dnf.Base):
# 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)]
+ # with the change to representing it as a tuple in DNF 3.6
+ # this '+= (tuple)' approach seems to work for DNF 2,
+ # 3.0-3.5 *and* 3.6
+ repo.baseurl += (_varSubstitute(url),)
if mirrorlist:
repo.mirrorlist = _varSubstitute(mirrorlist)
repo.enable()
--
2.19.0

View File

@ -10,7 +10,7 @@
Summary: Tools for building live CDs
Name: livecd-tools
Version: 25.0
Release: 10%{?dist}
Release: 11%{?dist}
Epoch: 1
License: GPLv2
Group: System Environment/Base
@ -21,8 +21,11 @@ Patch0: https://github.com/livecd-tools/livecd-tools/commit/491a49ff9aedf5197af3
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
# https://github.com/livecd-tools/livecd-tools/pull/102
Patch2: 0001-DNF-3-workaround-a-bug-with-config-values-that-are-l.patch
# Work around same issue again, for DNF 3.6 changes:
# https://github.com/livecd-tools/livecd-tools/pull/108
Patch3: 0001-Handle-dnf-config-option-showing-as-tuple-not-list-i.patch
BuildRequires: python2-devel
%if %{with python3}
@ -194,6 +197,9 @@ rm -rfv %{buildroot}%{_mandir}/man8/livecd-iso-to-*
%endif
%changelog
* Wed Sep 26 2018 Adam Williamson <awilliam@redhat.com> - 1:25.0-11
- Backport further fix for #1595917
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:25.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild