[jhbuild] Fixed assembling of git module URI in Python 2.6 (GNOME bug 618609)



commit e6fde3aa086c773800eb4b33cbe680a38c5d8095
Author: Frédéric Péters <fpeters 0d be>
Date:   Sat May 29 18:00:13 2010 +0200

    Fixed assembling of git module URI in Python 2.6 (GNOME bug 618609)
    
    The behaviour of urlparse.urljoin() changed in Python 2.6, making jhbuild
    creation of git URIs going wrong, as in losing components, e.g. from
      repos['git.gnome.org'] = 'ssh://fpeters git gnome org/git/'
    to
      ssh:/git/gnome-common
    
    Therefore go for same manual string concatenation code.

 jhbuild/versioncontrol/git.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/jhbuild/versioncontrol/git.py b/jhbuild/versioncontrol/git.py
index 68354f9..69e1720 100644
--- a/jhbuild/versioncontrol/git.py
+++ b/jhbuild/versioncontrol/git.py
@@ -96,7 +96,11 @@ class GitRepository(Repository):
                 if new_module:
                     module = new_module
         if not (urlparse.urlparse(module)[0] or module[0] == '/'):
-            module = urlparse.urljoin(self.href, module)
+            if self.href.endswith('/'):
+                base_href = self.href
+            else:
+                base_href = self.href + '/'
+            module = base_href + module
 
         if mirror_module:
             return GitBranch(self, mirror_module, subdir, checkoutdir,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]