diff options
Diffstat (limited to 'bitbake/lib/bb/fetch2/git.py')
| -rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 9 |
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) |
