summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2011-05-20 16:06:12 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-05-27 18:27:19 +0100
commit183ef127f555af68084ab956363b375124dd2a57 (patch)
treedcafcb0e5f40535cebfba24162bed08df2b0d1f4
parent5a4b8cef20ce22aebe87721290dd99f25d5bb686 (diff)
downloadpoky-183ef127f555af68084ab956363b375124dd2a57.tar.gz
fetch2/git: ensure network check log matches actual command
The git command string logged via check_network_access() does not match the actual command executed in a few places. Ensure that it does. (Bitbake rev: 10f3ca52dc274cd8b240987cfd7cd003aeda7ab1) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/fetch2/git.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 35a4bfd706..6979beaef5 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -167,8 +167,10 @@ class Git(FetchMethod):
167 167
168 # If the repo still doesn't exist, fallback to cloning it 168 # If the repo still doesn't exist, fallback to cloning it
169 if not os.path.exists(ud.clonedir): 169 if not os.path.exists(ud.clonedir):
170 bb.fetch2.check_network_access(d, "git clone --bare %s%s" % (ud.host, ud.path)) 170 clone_cmd = "%s clone --bare %s://%s%s%s %s" % \
171 runfetchcmd("%s clone --bare %s://%s%s%s %s" % (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.clonedir), d) 171 (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.clonedir)
172 bb.fetch2.check_network_access(d, clone_cmd)
173 runfetchcmd(clone_cmd, d)
172 174
173 os.chdir(ud.clonedir) 175 os.chdir(ud.clonedir)
174 # Update the checkout if needed 176 # Update the checkout if needed
@@ -177,7 +179,6 @@ class Git(FetchMethod):
177 if not self._contains_ref(ud.revisions[name], d): 179 if not self._contains_ref(ud.revisions[name], d):
178 needupdate = True 180 needupdate = True
179 if needupdate: 181 if needupdate:
180 bb.fetch2.check_network_access(d, "git fetch %s%s" % (ud.host, ud.path), ud.url)
181 try: 182 try:
182 runfetchcmd("%s remote prune origin" % ud.basecmd, d) 183 runfetchcmd("%s remote prune origin" % ud.basecmd, d)
183 runfetchcmd("%s remote rm origin" % ud.basecmd, d) 184 runfetchcmd("%s remote rm origin" % ud.basecmd, d)
@@ -185,7 +186,9 @@ class Git(FetchMethod):
185 logger.debug(1, "No Origin") 186 logger.debug(1, "No Origin")
186 187
187 runfetchcmd("%s remote add origin %s://%s%s%s" % (ud.basecmd, ud.proto, username, ud.host, ud.path), d) 188 runfetchcmd("%s remote add origin %s://%s%s%s" % (ud.basecmd, ud.proto, username, ud.host, ud.path), d)
188 runfetchcmd("%s fetch --all -t" % ud.basecmd, d) 189 fetch_cmd = "%s fetch --all -t" % ud.basecmd
190 bb.fetch2.check_network_access(d, fetch_cmd, ud.url)
191 runfetchcmd(fetch_cmd, d)
189 runfetchcmd("%s prune-packed" % ud.basecmd, d) 192 runfetchcmd("%s prune-packed" % ud.basecmd, d)
190 runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d) 193 runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d)
191 ud.repochanged = True 194 ud.repochanged = True
@@ -249,9 +252,10 @@ class Git(FetchMethod):
249 else: 252 else:
250 username = "" 253 username = ""
251 254
252 bb.fetch2.check_network_access(d, "git ls-remote %s%s %s" % (ud.host, ud.path, ud.branches[name]))
253 basecmd = data.getVar("FETCHCMD_git", d, True) or "git" 255 basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
254 cmd = "%s ls-remote %s://%s%s%s %s" % (basecmd, ud.proto, username, ud.host, ud.path, ud.branches[name]) 256 cmd = "%s ls-remote %s://%s%s%s %s" % \
257 (basecmd, ud.proto, username, ud.host, ud.path, ud.branches[name])
258 bb.fetch2.check_network_access(d, cmd)
255 output = runfetchcmd(cmd, d, True) 259 output = runfetchcmd(cmd, d, True)
256 if not output: 260 if not output:
257 raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, url) 261 raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, url)