Move the yum object initialization to it's own function.

This is necessary so that we can get a pypungi object without having to
init the repositories.
This commit is contained in:
Jesse Keating 2008-08-05 15:36:08 -04:00
parent bdaf3a662a
commit e9e0a1880c
2 changed files with 7 additions and 2 deletions

View File

@ -82,6 +82,8 @@ def main():
mypungi = pypungi.Pungi(config, ksparser)
if not opts.sourceisos:
if opts.do_all or opts.do_gather or opts.do_buildinstall:
mypungi._inityum() # initialize the yum object for things that need it
if opts.do_all or opts.do_gather:
mypungi.getPackageObjects()
mypungi.downloadPackages()

View File

@ -129,10 +129,13 @@ class Pungi(pypungi.PungiBase):
self.srpmlist = []
self.debuginfolist = []
self.resolved_deps = {} # list the deps we've already resolved, short circuit.
self.repos = []
self.mirrorlists = []
def _inityum(self):
"""Initialize the yum object. Only needed for certain actions."""
# Create a yum object to use
self.repos = []
self.mirrorlists = []
self.ayum = PungiYum(config)
self.ayum.doLoggingSetup(6, 6)
yumconf = yum.config.YumConf()