gather: Apply repo path substitutions for DNF backend
Use a method to add repos that will apply $arch and $basearch substitution automatically. Yum backend only applies $basearch, so if compatibility is needed, that one should be used. Drop code for handling mirrorlist, since Pungi does not ever use it, and being used externally is not really supported. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
c2c36dc3c2
commit
c6a86c444a
2 changed files with 10 additions and 17 deletions
|
|
@ -55,21 +55,14 @@ class DnfWrapper(dnf.Base):
|
|||
self.arch_wrapper = ArchWrapper(self.conf.substitutions["arch"])
|
||||
self.comps_wrapper = CompsWrapper(self)
|
||||
|
||||
def add_repo(
|
||||
self, repoid, baseurl=None, mirrorlist=None, enablegroups=True, lookaside=False
|
||||
):
|
||||
if "://" not in baseurl:
|
||||
baseurl = "file://%s" % os.path.abspath(baseurl)
|
||||
if LooseVersion(dnf.__version__) < LooseVersion("2.0.0"):
|
||||
repo = dnf.repo.Repo(repoid, self.conf.cachedir)
|
||||
else:
|
||||
repo = dnf.repo.Repo(repoid, self.conf)
|
||||
repo.baseurl = baseurl
|
||||
repo.mirrorlist = mirrorlist
|
||||
repo.enablegroups = enablegroups
|
||||
repo.enable()
|
||||
self.repos.add(repo)
|
||||
repo.priority = 10 if lookaside else 20
|
||||
def add_repo(self, repoid, baseurl=None, enablegroups=True, lookaside=False):
|
||||
self.repos.add_new_repo(
|
||||
repoid,
|
||||
self.conf,
|
||||
baseurl=[baseurl],
|
||||
enabledgroups=enablegroups,
|
||||
priority=10 if lookaside else 20,
|
||||
)
|
||||
|
||||
|
||||
class CompsWrapper(object):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue