[yum-commits] repoquery.py

skvidal at osuosl.org skvidal at osuosl.org
Wed Dec 2 23:13:24 UTC 2009


 repoquery.py |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 1a9418bdb0a9cf482555ad26e93e6af9cb6056f5
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Wed Dec 2 18:12:43 2009 -0500

    don't os.path.normpath() the loc b/c it clips the double / on http:// :(

diff --git a/repoquery.py b/repoquery.py
index 1b26249..4705554 100755
--- a/repoquery.py
+++ b/repoquery.py
@@ -26,6 +26,7 @@ import time
 import os
 import os.path
 import exceptions
+import urlparse
 
 from optparse import OptionParser
 
@@ -235,8 +236,11 @@ class pkgQuery:
         if self['basepath']:
             loc = "%(basepath)s/%(relativepath)s" % self
         else:
-            loc = "%s/%s" % (repo.urls[0], self['relativepath'])
-        return os.path.normpath(loc)
+            repourl = repo.urls[0]
+            if repourl[-1] != '/':
+                repourl = repourl + '/'
+            loc = urlparse.urljoin(repourl, self['relativepath'])
+        return loc
 
 class repoPkgQuery(pkgQuery):
     """


More information about the Yum-commits mailing list