From 197e13802200523200f779db5a55eb8d3bd3e425 Mon Sep 17 00:00:00 2001 From: Jaroslav Mracek Date: Fri, 16 Jun 2017 13:27:17 +0200 Subject: [PATCH] Add detection if mirrorlist is used for metalink This is a problem of EPEL repo where mirrorlist parameter is filled with metalink. Part of YUM-DNF compatibility. https://bugzilla.redhat.com/show_bug.cgi?id=1451212 Closes: #843 Approved by: dmach --- dnf/repo.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dnf/repo.py b/dnf/repo.py index 1f4fc867d7..c897566f97 100644 --- a/dnf/repo.py +++ b/dnf/repo.py @@ -699,6 +699,10 @@ def _handle_new_remote(self, destdir, mirror_setup=True): h.setopt(librepo.LRO_METALINKURL, mirrorlist) else: h.setopt(librepo.LRO_MIRRORLISTURL, mirrorlist) + # YUM-DNF compatibility hack. YUM guessed by content of keyword "metalink" if + # mirrorlist is really mirrorlist or metalink) + if 'metalink' in mirrorlist: + h.setopt(librepo.LRO_METALINKURL, mirrorlist) h.setopt(librepo.LRO_FASTESTMIRROR, self.fastestmirror) h.setopt(librepo.LRO_FASTESTMIRRORCACHE, os.path.join(self.basecachedir, 'fastestmirror.cache'))