[yum-cvs] repoquery.py

Tim Lauridsen timlau at linux.duke.edu
Thu Sep 6 13:12:14 UTC 2007


 repoquery.py |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 11a6fde9f3455ac8f0072692a1a9425aeefc8203
Author: Tim Lauridsen <tla at rasmil.dk>
Date:   Thu Sep 6 12:16:21 2007 +0200

    Make the --repofrompath take a repoid, so we know what to call the repo'

diff --git a/repoquery.py b/repoquery.py
index 244e390..aa100c3 100755
--- a/repoquery.py
+++ b/repoquery.py
@@ -720,22 +720,21 @@ def main(args):
 
     if opts.repofrompath:
         # setup the fake repos
-        for repopath in opts.repofrompath:
+        for repo in opts.repofrompath:
+            repoid,repopath = tuple(repo.split(','))
             if repopath[0] == '/':
                 baseurl = 'file://' + repopath
             else:
                 baseurl = repopath
                 
-            # get some kind of name - use the last dir name in the path
             repopath = os.path.normpath(repopath)
-            repoid = repopath.split('/')[-1]
-            
             newrepo = yum.yumRepo.YumRepository(repoid)
             newrepo.name = repopath
             newrepo.baseurl = baseurl
             newrepo.basecachedir = repoq.conf.cachedir
             repoq.repos.add(newrepo)
             repoq.repos.enableRepo(newrepo.id)
+            repoq.logger.info( "Added %s repo from %s" % (repoid,repopath))
 
         
     # Show what is going on, if --quiet is not set.



More information about the Yum-cvs-commits mailing list