[poky] [PATCH 2/3] fetch2/git: use urldata basecmd when available

Darren Hart dvhart at linux.intel.com
Fri May 20 16:06:13 PDT 2011


From: Darren Hart <dvhart at linux.intel.com>

If the urldata object is passed in, use it to determine basecmd rather
than looking it up again.

Signed-off-by: Darren Hart <dvhart at linux.intel.com>
Cc: Yu Ke <ke.yu at intel.com>
---
 bitbake/lib/bb/fetch2/git.py |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index c6c4cc9..7ffaa5e 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -137,10 +137,10 @@ class Git(FetchMethod):
 
         # If the repo still doesn't exist, fallback to cloning it
         if not os.path.exists(ud.clonedir):
-            clone_cmd = "%s clone --bare %s://%s%s%s %s" % \
+            cmd = "%s clone --bare %s://%s%s%s %s" % \
                   (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.clonedir)
-            bb.fetch2.check_network_access(d, clone_cmd)
-            runfetchcmd(clone_cmd, d)
+            bb.fetch2.check_network_access(d, cmd)
+            runfetchcmd(cmd, d)
 
         os.chdir(ud.clonedir)
         # Update the checkout if needed
@@ -156,9 +156,9 @@ class Git(FetchMethod):
                 logger.debug(1, "No Origin")
             
             runfetchcmd("%s remote add origin %s://%s%s%s" % (ud.basecmd, ud.proto, username, ud.host, ud.path), d)
-            fetch_cmd = "%s fetch --all -t" % ud.basecmd
-            bb.fetch2.check_network_access(d, fetch_cmd, ud.url)
-            runfetchcmd(fetch_cmd, d)
+            cmd = "%s fetch --all -t" % ud.basecmd
+            bb.fetch2.check_network_access(d, cmd, ud.url)
+            runfetchcmd(cmd, d)
             runfetchcmd("%s prune-packed" % ud.basecmd, d)
             runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d)
             ud.repochanged = True
@@ -219,9 +219,8 @@ class Git(FetchMethod):
         else:
             username = ""
 
-        basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
         cmd = "%s ls-remote %s://%s%s%s %s" % \
-              (basecmd, ud.proto, username, ud.host, ud.path, ud.branches[name])
+              (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.branches[name])
         bb.fetch2.check_network_access(d, cmd)
         output = runfetchcmd(cmd, d, True)
         if not output:
-- 
1.7.1




More information about the poky mailing list