[yum-commits] repoquery.py

skvidal at osuosl.org skvidal at osuosl.org
Wed Nov 4 21:58:35 UTC 2009


 repoquery.py |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 39b581cc96d26d623544c17303804088d3fd939c
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Wed Nov 4 16:57:25 2009 -0500

    - add fmt_location  to pkgquery objects
    - make --location a pkg operation not a sack operation
    closes rh bug 533024

diff --git a/repoquery.py b/repoquery.py
index 6ddbddc..1b26249 100755
--- a/repoquery.py
+++ b/repoquery.py
@@ -229,6 +229,15 @@ class pkgQuery:
     def fmt_envra(self, **kw):
         return "%(envr)s.%(arch)s" % self
 
+    def fmt_location(self, **kw):
+        loc = ''
+        repo = self.pkg.repo
+        if self['basepath']:
+            loc = "%(basepath)s/%(relativepath)s" % self
+        else:
+            loc = "%s/%s" % (repo.urls[0], self['relativepath'])
+        return os.path.normpath(loc)
+
 class repoPkgQuery(pkgQuery):
     """
     I wrap a query of a non-installed package available in the repository.
@@ -742,7 +751,7 @@ def main(args):
     if opts.file:
         sackops.append("whatprovides")
     if opts.location:
-        sackops.append("location")
+        pkgops.append("location")
     if opts.groupmember:
         sackops.append("groupmember")
         needgroup = 1


More information about the Yum-commits mailing list