[yum-commits] repoclosure.py

Tim Lauridsen timlau at osuosl.org
Thu Dec 25 15:43:53 UTC 2008


 repoclosure.py |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 390a4baacb25d6209c430bae9e8ec2879a715313
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date:   Thu Dec 25 16:43:30 2008 +0100

    Check for the repoclosure of a single package patch by Kedar Sovani

diff --git a/repoclosure.py b/repoclosure.py
index 8c7db9a..de612c3 100755
--- a/repoclosure.py
+++ b/repoclosure.py
@@ -58,15 +58,18 @@ def parseArgs():
                       help="check only the newest packages in the repos")
     parser.add_option("--repofrompath", action="append",
                       help="specify repoid & paths of additional repositories - unique repoid and complete path required, can be specified multiple times. Example. --repofrompath=myrepo,/path/to/repo")
+    parser.add_option("-p", "--pkg", action="append",
+                      help="check closure for this package only")
     (opts, args) = parser.parse_args()
     return (opts, args)
 
 class RepoClosure(yum.YumBase):
-    def __init__(self, arch = [], config = "/etc/yum.conf", builddeps = False):
+    def __init__(self, pkgonly, arch = [], config = "/etc/yum.conf", builddeps = False ):
         yum.YumBase.__init__(self)
         self.logger = logging.getLogger("yum.verbose.repoclosure")
         self.arch = arch
         self.builddeps = builddeps
+        self.pkgonly = pkgonly
         self.doConfigSetup(fn = config,init_plugins=False)
         if hasattr(self.repos, 'sqlite'):
             self.repos.sqlite = False
@@ -118,6 +121,9 @@ class RepoClosure(yum.YumBase):
         if self.builddeps:
             pkgs = filter(lambda x: x.arch == 'src', pkgs)
 
+        if self.pkgonly:
+            pkgs = filter(lambda x: x.name == self.pkgonly[0], pkgs)
+
         for pkg in pkgs:
             for (req, flags, (reqe, reqv, reqr)) in pkg.returnPrco('requires'):
                 if req.startswith('rpmlib'): continue # ignore rpmlib deps
@@ -155,7 +161,7 @@ class RepoClosure(yum.YumBase):
 
 def main():
     (opts, cruft) = parseArgs()
-    my = RepoClosure(arch = opts.arch, config = opts.config, builddeps = opts.builddeps)
+    my = RepoClosure(arch = opts.arch, config = opts.config, builddeps = opts.builddeps, pkgonly = opts.pkg)
 
     if opts.repofrompath:
         # setup the fake repos


More information about the Yum-commits mailing list