diff --git a/pungi b/pungi index d824ac98..d76dcead 100755 --- a/pungi +++ b/pungi @@ -70,16 +70,6 @@ def main(): if part.mountpoint == 'iso': config.set('default', 'cdsize', part.size) - # Build up a package dict. - pkgdict = {'groups': [], 'packages': [], 'excludes': []) - for group in ksparser.handler.packages.groupList: - if group.include == 1: - pkgdict['groups'].append(group.name) - - pkgdict['packages'].extend(ksparser.handler.packages.packageList) - - pkgdict['excludes'].extend(ksparser.handler.packages.excludedList) - # Set up our directories if not os.path.exists(config.get('default', 'destdir')): try: @@ -100,7 +90,7 @@ def main(): # Actually do work. if not config.get('default', 'arch') == 'source': if opts.do_all or opts.do_gather: - mygather = pypungi.gather.Gather(config, pkgdict) + mygather = pypungi.gather.Gather(config, ksparser) mygather.getPackageObjects() mygather.downloadPackages() mygather.makeCompsFile() diff --git a/pypungi/gather.py b/pypungi/gather.py index bda70b61..067adfef 100755 --- a/pypungi/gather.py +++ b/pypungi/gather.py @@ -47,7 +47,7 @@ class PungiYum(yum.YumBase): pass class Gather(pypungi.PungiBase): - def __init__(self, config, pkgdict): + def __init__(self, config, ksparser): pypungi.PungiBase.__init__(self, config) # Set our own logging name space @@ -60,7 +60,7 @@ class Gather(pypungi.PungiBase): console.setLevel(logging.INFO) self.logger.addHandler(console) - self.pkgdict = pkgdict + self.ksparser = ksparser self.config.cachedir = os.path.join(self.workdir, 'yumcache') self.polist = [] self.srpmlist = [] @@ -209,16 +209,26 @@ class Gather(pypungi.PungiBase): searchlist = [] # The list of package names/globs to search for matchdict = {} # A dict of objects to names + # Build up a package dict. + pkgdict = {'groups': [], 'packages': [], 'excludes': []) + for group in self.ksparser.handler.packages.groupList: + if group.include == 1: + pkgdict['groups'].append(group.name) + + pkgdict['packages'].extend(self.ksparser.handler.packages.packageList) + + pkgdict['excludes'].extend(self.ksparser.handler.packages.excludedList) + # First remove the excludes - self.ayum.conf.exclude.extend(self.pkgdict['excludes']) + self.ayum.conf.exclude.extend(pkgdict['excludes']) self.ayum.excludePackages() # Get a list of packages from groups - for group in self.pkgdict['groups']: + for group in pkgdict['groups']: searchlist.extend(self.getPackagesFromGroup(group)) # Add the adds - searchlist.extend(self.pkgdict['packages']) + searchlist.extend(pkgdict['packages']) # Make the search list unique searchlist = yum.misc.unique(searchlist)