[jhbuild] [git] strip .git off git module names (GNOME bug 591508)



commit 6d1052d49bcd3accfeca7683dd36b2f4ae4f361f
Author: Frédéric Péters <fpeters 0d be>
Date:   Wed Aug 12 16:59:44 2009 +0200

    [git] strip .git off git module names (GNOME bug 591508)

 jhbuild/versioncontrol/__init__.py |    7 +++++--
 jhbuild/versioncontrol/git.py      |    6 ++++++
 2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/versioncontrol/__init__.py b/jhbuild/versioncontrol/__init__.py
index 87de336..0c10d1a 100644
--- a/jhbuild/versioncontrol/__init__.py
+++ b/jhbuild/versioncontrol/__init__.py
@@ -96,13 +96,16 @@ class Branch:
            May raise NotImplementedError if cannot check a given branch."""
         raise NotImplementedError
 
+    def get_module_basename(self):
+        return os.path.basename(self.module)
+
     def get_checkoutdir(self):
         if self.checkout_mode == 'copy' and self.config.copy_dir:
-            return os.path.join(self.config.copy_dir, os.path.basename(self.module))
+            return os.path.join(self.config.copy_dir, self.get_module_basename())
         if self.checkoutdir:
             return os.path.join(self.checkoutroot, self.checkoutdir)
         else:
-            return os.path.join(self.checkoutroot, os.path.basename(self.module))
+            return os.path.join(self.checkoutroot, self.get_module_basename())
 
     def may_checkout(self, buildscript):
         if buildscript.config.nonetwork:
diff --git a/jhbuild/versioncontrol/git.py b/jhbuild/versioncontrol/git.py
index ca95f46..d5f6de0 100644
--- a/jhbuild/versioncontrol/git.py
+++ b/jhbuild/versioncontrol/git.py
@@ -119,6 +119,12 @@ class GitBranch(Branch):
         self.tag = tag
         self.unmirrored_module = unmirrored_module
 
+    def get_module_basename(self):
+        name = os.path.basename(self.module)
+        if name.endswith('.git'):
+            name = name[:-4]
+        return name
+ 
     def srcdir(self):
         path_elements = [self.checkoutroot]
         if self.checkoutdir:



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