summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2
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:15:50 +0100
commitd5847bc5254b9d2f28a6b574f6157d1286add27c (patch)
treeb2ae8cd8f3231954d440798b67f809f5d4aaacc2 /lib/bb/fetch2
parent270a05b0b4ba0959fe0624d2a4885d7b70426da5 (diff)
downloadbitbake-d5847bc5254b9d2f28a6b574f6157d1286add27c.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'. Signed-off-by: Jeff Polk <jeff.polk@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2')
-rw-r--r--lib/bb/fetch2/git.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 61fdc4b05..bcc0da583 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -184,7 +184,8 @@ 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 --mirror %s %s" % (ud.basecmd, repourl, ud.clonedir)
- bb.fetch2.check_network_access(d, clone_cmd)
+ if ud.proto.lower() != 'file':
+ bb.fetch2.check_network_access(d, clone_cmd)
runfetchcmd(clone_cmd, d)
os.chdir(ud.clonedir)
@@ -202,7 +203,8 @@ class Git(FetchMethod):
runfetchcmd("%s remote add --mirror=fetch origin %s" % (ud.basecmd, repourl), d)
fetch_cmd = "%s fetch -f --prune %s refs/*:refs/*" % (ud.basecmd, repourl)
- bb.fetch2.check_network_access(d, fetch_cmd, ud.url)
+ if ud.proto.lower() != 'file':
+ bb.fetch2.check_network_access(d, fetch_cmd, ud.url)
runfetchcmd(fetch_cmd, d)
runfetchcmd("%s prune-packed" % ud.basecmd, d)
runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d)
@@ -281,7 +283,8 @@ class Git(FetchMethod):
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])
- bb.fetch2.check_network_access(d, cmd)
+ if ud.proto.lower() != 'file':
+ bb.fetch2.check_network_access(d, cmd)
output = runfetchcmd(cmd, d, True)
if not output:
raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, url)