[yum-commits] repoclosure.py

skvidal at osuosl.org skvidal at osuosl.org
Tue Sep 8 21:21:07 UTC 2009


 repoclosure.py |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 4ebf035d43f24fdeffdbea1d51f44bc2ffbcc055
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Sep 8 17:20:27 2009 -0400

    add --basearch option  to repoclosure
    
    set basearch yum should run as.

diff --git a/repoclosure.py b/repoclosure.py
index 13e52ab..5076fe8 100755
--- a/repoclosure.py
+++ b/repoclosure.py
@@ -47,6 +47,8 @@ def parseArgs():
     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("--basearch", default=None, 
+                      help="set the basearch for yum to run as")
     parser.add_option("-b", "--builddeps", default=False, action="store_true",
         help='check build dependencies only (needs source repos enabled)')
     parser.add_option("-r", "--repoid", default=[], action='append',
@@ -67,8 +69,11 @@ def parseArgs():
 #  Note that this is a "real" API, used by spam-o-matic etc.
 # so we have to do at least some API guarantee stuff.
 class RepoClosure(yum.YumBase):
-    def __init__(self, arch=[], config="/etc/yum.conf", builddeps=False, pkgonly=None):
+    def __init__(self, arch=[], config="/etc/yum.conf", builddeps=False, pkgonly=None,
+                 basearch=None):
         yum.YumBase.__init__(self)
+        if basearch:
+            self.preconf.arch = basearch
         self.logger = logging.getLogger("yum.verbose.repoclosure")
         self.builddeps = builddeps
         self.pkgonly = pkgonly
@@ -180,7 +185,11 @@ class RepoClosure(yum.YumBase):
 
 def main():
     (opts, cruft) = parseArgs()
-    my = RepoClosure(arch = opts.arch, config = opts.config, builddeps = opts.builddeps, pkgonly = opts.pkg)
+    my = RepoClosure(arch=opts.arch, 
+                     config=opts.config, 
+                     builddeps=opts.builddeps,
+                     pkgonly=opts.pkg,
+                     basearch=opts.basearch)
 
     if opts.repofrompath:
         # setup the fake repos


More information about the Yum-commits mailing list