summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorJeff Polk <jeff.polk@windriver.com>2012-05-04 08:05:14 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-04 16:44:57 +0100
commitca8e06e8a00aca5466a871dab31598473d5cb306 (patch)
tree361444ae40a7a8fad7971664da98d430e9b631f9 /bitbake/lib/bb
parent2e9bb9d103def3ce7499e1a09e47b9297f85c488 (diff)
downloadpoky-ca8e06e8a00aca5466a871dab31598473d5cb306.tar.gz
fetch2/git: Allow file:// URLs without checking for network access
Don't check for network access before grabbing the the current head, cloning, or updating a clone when the protocol is 'file'. (Bitbake rev: d5847bc5254b9d2f28a6b574f6157d1286add27c) Signed-off-by: Jeff Polk <jeff.polk@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/fetch2/git.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 61fdc4b05e..bcc0da583b 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -184,7 +184,8 @@ class Git(FetchMethod):
184 # If the repo still doesn't exist, fallback to cloning it 184 # If the repo still doesn't exist, fallback to cloning it
185 if not os.path.exists(ud.clonedir): 185 if not os.path.exists(ud.clonedir):
186 clone_cmd = "%s clone --bare --mirror %s %s" % (ud.basecmd, repourl, ud.clonedir) 186 clone_cmd = "%s clone --bare --mirror %s %s" % (ud.basecmd, repourl, ud.clonedir)
187 bb.fetch2.check_network_access(d, clone_cmd) 187 if ud.proto.lower() != 'file':
188 bb.fetch2.check_network_access(d, clone_cmd)
188 runfetchcmd(clone_cmd, d) 189 runfetchcmd(clone_cmd, d)
189 190
190 os.chdir(ud.clonedir) 191 os.chdir(ud.clonedir)
@@ -202,7 +203,8 @@ class Git(FetchMethod):
202 203
203 runfetchcmd("%s remote add --mirror=fetch origin %s" % (ud.basecmd, repourl), d) 204 runfetchcmd("%s remote add --mirror=fetch origin %s" % (ud.basecmd, repourl), d)
204 fetch_cmd = "%s fetch -f --prune %s refs/*:refs/*" % (ud.basecmd, repourl) 205 fetch_cmd = "%s fetch -f --prune %s refs/*:refs/*" % (ud.basecmd, repourl)
205 bb.fetch2.check_network_access(d, fetch_cmd, ud.url) 206 if ud.proto.lower() != 'file':
207 bb.fetch2.check_network_access(d, fetch_cmd, ud.url)
206 runfetchcmd(fetch_cmd, d) 208 runfetchcmd(fetch_cmd, d)
207 runfetchcmd("%s prune-packed" % ud.basecmd, d) 209 runfetchcmd("%s prune-packed" % ud.basecmd, d)
208 runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d) 210 runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d)
@@ -281,7 +283,8 @@ class Git(FetchMethod):
281 basecmd = data.getVar("FETCHCMD_git", d, True) or "git" 283 basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
282 cmd = "%s ls-remote %s://%s%s%s %s" % \ 284 cmd = "%s ls-remote %s://%s%s%s %s" % \
283 (basecmd, ud.proto, username, ud.host, ud.path, ud.branches[name]) 285 (basecmd, ud.proto, username, ud.host, ud.path, ud.branches[name])
284 bb.fetch2.check_network_access(d, cmd) 286 if ud.proto.lower() != 'file':
287 bb.fetch2.check_network_access(d, cmd)
285 output = runfetchcmd(cmd, d, True) 288 output = runfetchcmd(cmd, d, True)
286 if not output: 289 if not output:
287 raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, url) 290 raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, url)