extras-repoclosure rc-modified,1.32,1.33
Michael Schwendt
mschwendt at fedoraproject.org
Mon Sep 7 11:56:50 UTC 2009
- Previous message (by thread): rpms/alsa-utils/F-11 alsactl-init-add-speaker.patch, NONE, 1.1 alsa-utils.spec, 1.86, 1.87
- Next message (by thread): rpms/slang/devel .cvsignore, 1.15, 1.16 slang.spec, 1.56, 1.57 sources, 1.15, 1.16
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: mschwendt
Update of /cvs/fedora/extras-repoclosure
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv14743
Modified Files:
rc-modified
Log Message:
add conditional support for Yum 3.2.24 arch list changes
Index: rc-modified
===================================================================
RCS file: /cvs/fedora/extras-repoclosure/rc-modified,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- rc-modified 7 Sep 2009 09:31:56 -0000 1.32
+++ rc-modified 7 Sep 2009 11:56:49 -0000 1.33
@@ -25,6 +25,7 @@
import os
import re
import string
+import errno
# For patched "yum" and "rpmUtils" (post 2.6.1 checkForObsolete support).
# Comment this to use system yum.
@@ -47,8 +48,9 @@
parser = OptionParser(usage=usage)
parser.add_option("-c", "--config", default='/etc/yum.conf',
help='config file to use (defaults to /etc/yum.conf)')
- parser.add_option("-a", "--arch", default=None,
- help='check as if running the specified arch (default: current arch)')
+ parser.add_option("-a", "--arch", default=[], action='append',
+ help='check packages of the given archs, can be specified multiple ' +
+ 'times (default: current arch)')
parser.add_option("-r", "--repoid", default=[], action='append',
help="specify repo ids to query, can be specified multiple times (default is all enabled)")
parser.add_option("-t", "--tempcache", default=False, action="store_true",
@@ -67,10 +69,16 @@
return (opts, args)
class RepoClosure(yum.YumBase):
- def __init__(self, arch = None, config = "/etc/yum.conf"):
+ def __init__(self, arch = [], config = "/etc/yum.conf"):
yum.YumBase.__init__(self)
- self.arch = arch
+ if yum.__version__ < '3.2.24':
+ if arch:
+ self.arch = arch[0]
+ else:
+ self.arch = None
+ else:
+ self._rc_arches = arch
if yum.__version__ < '3.0': # TODO: check
self.doConfigSetup(fn = config)
else:
@@ -103,7 +111,18 @@
def readMetadata(self):
self.doRepoSetup()
- self.doSackSetup(rpmUtils.arch.getArchList(self.arch))
+
+ if yum.__version__ < '3.2.24':
+ self.doSackSetup(rpmUtils.arch.getArchList(self.arch))
+ else:
+ archs = []
+ if not self._rc_arches:
+ archs.extend(self.arch.archlist)
+ else:
+ for arch in self._rc_arches:
+ archs.extend(self.arch.get_arch_list(arch))
+ self.doSackSetup(archs)
+
for repo in self.repos.listEnabled():
try: # TODO: when exactly did this change from "with=" to "mdtype="?
self.repos.populateSack(which=[repo.id], mdtype='filelists')
@@ -317,6 +336,11 @@
def main():
(opts, cruft) = parseArgs()
+ if yum.__version__ < '3.2.24':
+ if len(opts.arch)>1:
+ print 'ERROR: can handle only a single arch with Yum < 3.2.24'
+ sys.exit(errno.EINVAL)
+
my = RepoClosure(arch = opts.arch, config = opts.config)
my.guessMultiLibProbs = not opts.nomultilibhack
my.rawhidehack = opts.rawhidehack
- Previous message (by thread): rpms/alsa-utils/F-11 alsactl-init-add-speaker.patch, NONE, 1.1 alsa-utils.spec, 1.86, 1.87
- Next message (by thread): rpms/slang/devel .cvsignore, 1.15, 1.16 slang.spec, 1.56, 1.57 sources, 1.15, 1.16
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list