livecd-tools/0001-DNF-3-workaround-a-bug...

39 lines
1.3 KiB
Diff

From 676b1e1261b442a80cdf2cbb96d192b1db02b894 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
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 <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 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