[yum-commits] repoquery.py

skvidal at osuosl.org skvidal at osuosl.org
Mon Jan 18 16:44:37 UTC 2010


 repoquery.py |   15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

New commits:
commit 318e4dbf39d3f3bd6aa5c34d4a91761e93b88acc
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Mon Jan 18 11:44:06 2010 -0500

    make repofrompath use add_enable_repo from yumbase rather than its own thing
    fixes up using --group* commands from --repofrompath repos and also catches
    GroupsErrors properly at setup
    closes rh bug: https://bugzilla.redhat.com/show_bug.cgi?id=556215

diff --git a/repoquery.py b/repoquery.py
index d92cd91..0a1e76b 100755
--- a/repoquery.py
+++ b/repoquery.py
@@ -786,15 +786,8 @@ def main(args):
             else:
                 baseurl = repopath
                 
-            repopath = os.path.normpath(repopath)
-            newrepo = yum.yumRepo.YumRepository(repoid)
-            newrepo.name = repopath
-            newrepo.baseurl = baseurl
-            newrepo.basecachedir = repoq.conf.cachedir
-            newrepo.metadata_expire = 0
-            newrepo.timestamp_check = False
-            repoq.repos.add(newrepo)
-            repoq.repos.enableRepo(newrepo.id)
+            repoq.add_enable_repo(repoid, baseurls=[baseurl], 
+                    basecachedir=repoq.conf.cachedir)
             if not opts.quiet:
                 repoq.logger.info( "Added %s repo from %s" % (repoid,repopath))
 
@@ -862,8 +855,8 @@ def main(args):
             repoq.repos.populateSack(mdtype='otherdata')
         if needgroup:
             repoq.doGroupSetup()
-    except yum.Errors.RepoError, e:
-        repoq.logger.error( e)
+    except (yum.Errors.RepoError, yum.Errors.GroupsError), e:
+        repoq.logger.error(e)
         sys.exit(1)
 
     repoq.runQuery(regexs)


More information about the Yum-commits mailing list