The Git fetcher currently hardwires the git command to "git". Allow the
path and any additional wrappers to the Git command to be provided via
FETCHCMD functionality, as with some of the other fetchers.

This requires FETCHCMD_svn to be defined in bitbake.conf.

Signed-off-by: Malcolm Crossley <[email protected]>
Signed-off-by: Martyn Welch <[email protected]>
---

This patch is against the "1.8" branch.

 lib/bb/fetch/git.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/bb/fetch/git.py b/lib/bb/fetch/git.py
index 5cdf656..a051e3f 100644
--- a/lib/bb/fetch/git.py
+++ b/lib/bb/fetch/git.py
@@ -79,6 +79,7 @@ class Git(Fetch):
 
         coname = '%s' % (ud.tag)
         codir = os.path.join(repodir, coname)
+        basecmd = data.expand('${FETCHCMD_git}', d)
 
         if not os.path.exists(repodir):
             if Fetch.try_mirror(d, repofilename):    
@@ -86,14 +87,14 @@ class Git(Fetch):
                 os.chdir(repodir)
                 runfetchcmd("tar -xzf %s" % (repofile), d)
             else:
-                runfetchcmd("git clone -n %s://%s%s%s %s" % (ud.proto, 
username, ud.host, ud.path, repodir), d)
+                runfetchcmd("%s clone -n %s://%s%s%s %s" % (basecmd, ud.proto, 
username, ud.host, ud.path, repodir), d)
 
         os.chdir(repodir)
         # Remove all but the .git directory
         if not self._contains_ref(ud.tag, d):
             runfetchcmd("rm * -Rf", d)
-            runfetchcmd("git fetch %s://%s%s%s %s" % (ud.proto, username, 
ud.host, ud.path, ud.branch), d)
-            runfetchcmd("git fetch --tags %s://%s%s%s" % (ud.proto, username, 
ud.host, ud.path), d)
+            runfetchcmd("%s fetch %s://%s%s%s %s" % (basecmd, ud.proto, 
username, ud.host, ud.path, ud.branch), d)
+            runfetchcmd("%s fetch --tags %s://%s%s%s" % (basecmd, ud.proto, 
username, ud.host, ud.path), d)
             runfetchcmd("git prune-packed", d)
             runfetchcmd("git pack-redundant --all | xargs -r rm", d)
 
@@ -140,7 +141,8 @@ class Git(Fetch):
         else:
             username = ""
 
-        output = runfetchcmd("git ls-remote %s://%s%s%s %s" % (ud.proto, 
username, ud.host, ud.path, ud.branch), d, True)
+        basecmd = data.expand('${FETCHCMD_git}', d)
+        output = runfetchcmd("%s ls-remote %s://%s%s%s %s" % (basecmd, 
ud.proto, username, ud.host, ud.path, ud.branch), d, True)
         return output.split()[0]
 
     def _build_revision(self, url, ud, d):


--
Martyn Welch MEng MPhil MIET (Principal Software Engineer)   T:+44(0)1327322748
GE Fanuc Intelligent Platforms Ltd,        |Registered in England and Wales
Tove Valley Business Park, Towcester,      |(3828642) at 100 Barbirolli Square,
Northants, NN12 6PF, UK T:+44(0)1327359444 |Manchester,M2 3AB  VAT:GB 927559189
_______________________________________________
Bitbake-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bitbake-dev

Reply via email to