Skip to content

Commit

Permalink
Add detection if mirrorlist is used for metalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
j-mracek authored and DNF Bot committed Jun 29, 2017
1 parent 65fdd92 commit 197e138
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dnf/repo.py
Expand Up @@ -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'))
Expand Down

0 comments on commit 197e138

Please sign in to comment.