Adjust calls to the single class, only create the object once.

This commit is contained in:
Jesse Keating 2008-06-12 09:06:19 -04:00
parent 4627931835
commit 043a799b25

View File

@ -76,19 +76,16 @@ def main():
sys.exit(1) sys.exit(1)
# Actually do work. # Actually do work.
mypungi = pypungi.Pungi(config, ksparser)
if not opts.sourceisos: if not opts.sourceisos:
if opts.do_all or opts.do_gather: if opts.do_all or opts.do_gather:
mygather = pypungi.gather.Gather(config, ksparser) mypungi.getPackageObjects()
mygather.getPackageObjects() mypungi.downloadPackages()
mygather.downloadPackages() mypungi.makeCompsFile()
mygather.makeCompsFile()
if not opts.nosource: if not opts.nosource:
mygather.getSRPMList() mypungi.getSRPMList()
mygather.downloadSRPMs() mypungi.downloadSRPMs()
del mygather
mypungi = pypungi.pungi.Pungi(config)
if opts.do_all or opts.do_createrepo: if opts.do_all or opts.do_createrepo:
mypungi.doCreaterepo() mypungi.doCreaterepo()
@ -103,7 +100,6 @@ def main():
# Do things slightly different for src. # Do things slightly different for src.
if opts.sourceisos: if opts.sourceisos:
# we already have all the content gathered # we already have all the content gathered
mypungi = pypungi.pungi.Pungi(config)
mypungi.topdir = os.path.join(config.get('default', 'destdir'), mypungi.topdir = os.path.join(config.get('default', 'destdir'),
config.get('default', 'version'), config.get('default', 'version'),
config.get('default', 'flavor'), config.get('default', 'flavor'),