summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Schild <henning.schild@siemens.com>2021-04-14 08:32:39 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-18 11:38:22 +0100
commit2cb6ce778804deb9666cf09a7ada787c9f7936cf (patch)
tree0a4104f5fab4e277da24d81dbb3d2f29797b5694
parent33650ffdc7810f79b4a325f4ade01e309d3728d5 (diff)
downloadpoky-2cb6ce778804deb9666cf09a7ada787c9f7936cf.tar.gz
bitbake: fetch/git: add support for disabling shared clones on unpack
By default the unpacker will create a "shared" clone when cloning from the DL_DIR to the WORKDIR. This patch introduces an option to control that behaviour. Imagine some recipe steps are executed in a namespace that is different from the one your downloader and unpacker ran in. (chroot) Because a "shared" clone has an absolute reference to its "alternate" you now have to make that "alternate" visible in that new namespace (chroot) at the exact place. With this patch you can unpack "noshared" and get a stand-alone copy. This copy will also work if the "alternate" is not visible or existant. The switch is a global bitbake switch and will affect all git urls. Build systems that need "noshared" most likely need it for everything they do with git. (Bitbake rev: 6ae6f1865d5e666ebc670f70b7401a7b41648102) Signed-off-by: Henning Schild <henning.schild@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/fetch2/git.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index e3ba80a3f5..3e25b4b604 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -168,7 +168,11 @@ class Git(FetchMethod):
168 if len(branches) != len(ud.names): 168 if len(branches) != len(ud.names):
169 raise bb.fetch2.ParameterError("The number of name and branch parameters is not balanced", ud.url) 169 raise bb.fetch2.ParameterError("The number of name and branch parameters is not balanced", ud.url)
170 170
171 ud.cloneflags = "-s -n" 171 ud.noshared = d.getVar("BB_GIT_NOSHARED") == "1"
172
173 ud.cloneflags = "-n"
174 if not ud.noshared:
175 ud.cloneflags += " -s"
172 if ud.bareclone: 176 if ud.bareclone:
173 ud.cloneflags += " --mirror" 177 ud.cloneflags += " --mirror"
174 178