From 1c88ab914ab3c83b96182aa241ab28fcf81be70d Mon Sep 17 00:00:00 2001 From: "jkeating@localhost.localdomain" <> Date: Sun, 15 Oct 2006 17:30:01 -0400 Subject: [PATCH] First stab at doing arch specific setups --- gather/gather.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/gather/gather.py b/gather/gather.py index 850bcb1e..866d6188 100755 --- a/gather/gather.py +++ b/gather/gather.py @@ -22,7 +22,16 @@ class Gather(yum.YumBase): yum.YumBase.__init__(self) self.doConfigSetup(fn=opts.yumconf) self.doRepoSetup() - self.doSackSetup() + # setup archlist + self.archlist = [] + if opts.arch == 'i386': + self.archlist = ['athlon', 'i686', 'i586', 'i486', 'i386', 'noarch'] + if opts.arch == 'x86_64': + self.archlist = ['x86_64', 'athlon', 'i686', 'i586', 'i486', 'i386', 'noarch'] + if opts.arch == 'ppc': + self.archlist = ['ppc64', 'ppc', 'noarch'] + print self.archlist #debug + self.doSackSetup(archlist=self.archlist) self.logger = yum.logging.getLogger("yum.verbose.fist") self.opts = opts self.pkglist = pkglist @@ -36,7 +45,7 @@ class Gather(yum.YumBase): if not self.opts.quiet: - self.logger.info('Checking deps of %s' % po.name) + self.logger.info('Checking deps of %s.%s' % (po.name, po.arch)) reqs = po.requires; reqs.sort() @@ -62,7 +71,8 @@ class Gather(yum.YumBase): final_pkgobjs = [] # The final list of package objects for pkg in self.pkglist: # cycle through our package list and get repo matches - unprocessed_pkgs.extend(self.pkgSack.searchNevra(name=pkg)) + for arch in self.archlist: + unprocessed_pkgs.extend(self.pkgSack.searchNevra(name=pkg, arch=arch)) if len(unprocessed_pkgs) == 0: raise yum.Errors.MiscError, 'No packages found to download.' @@ -159,6 +169,8 @@ if __name__ == '__main__': help='comps file to use') parser.add_option("--yumconf", default="yum.conf", dest="yumconf", help='yum config file to use') + parser.add_option("--arch", default="i386", dest="arch", + help='Base arch to use') parser.add_option("-q", "--quiet", default=False, action="store_true", help="Output as little as possible")