summaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3-adas/docs/sample/patch/0003-poky-bitbake-gitsm-fix-BB_NO_NETWORK-build.patch
diff options
context:
space:
mode:
authorVladimir Barinov <vladimir.barinov@cogentembedded.com>2017-09-17 00:42:02 +0300
committerVladimir Barinov <vladimir.barinov@cogentembedded.com>2017-09-20 01:44:28 +0300
commitabceb74f0295cfe7d7b174ee4b8b3d35a571f309 (patch)
tree57eb93743cb3d2538566e16257facb9a992f9498 /meta-rcar-gen3-adas/docs/sample/patch/0003-poky-bitbake-gitsm-fix-BB_NO_NETWORK-build.patch
parentbc699eede30c964b938512470231f6f6088a636b (diff)
Build offline patches
This patches will alow to build with BB_NO_NETWORK=1 only from download cache
Diffstat (limited to 'meta-rcar-gen3-adas/docs/sample/patch/0003-poky-bitbake-gitsm-fix-BB_NO_NETWORK-build.patch')
-rw-r--r--meta-rcar-gen3-adas/docs/sample/patch/0003-poky-bitbake-gitsm-fix-BB_NO_NETWORK-build.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/meta-rcar-gen3-adas/docs/sample/patch/0003-poky-bitbake-gitsm-fix-BB_NO_NETWORK-build.patch b/meta-rcar-gen3-adas/docs/sample/patch/0003-poky-bitbake-gitsm-fix-BB_NO_NETWORK-build.patch
new file mode 100644
index 0000000..4160351
--- /dev/null
+++ b/meta-rcar-gen3-adas/docs/sample/patch/0003-poky-bitbake-gitsm-fix-BB_NO_NETWORK-build.patch
@@ -0,0 +1,47 @@
+From e0eb46a08a0bdd278800f75c0004e33af2376374 Mon Sep 17 00:00:00 2001
+From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
+Date: Sun, 17 Sep 2017 00:39:12 +0300
+Subject: [PATCH] poky: bitbake: gitsm: fix BB_NO_NETWORK build
+
+This allows to fetch submodules from download cache.
+
+Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de>
+Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
+---
+ bitbake/lib/bb/fetch2/gitsm.py | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py
+index 752f1d3..cb417a3 100644
+--- a/bitbake/lib/bb/fetch2/gitsm.py
++++ b/bitbake/lib/bb/fetch2/gitsm.py
+@@ -109,7 +109,7 @@ class GitSM(Git):
+ runfetchcmd("sed " + gitdir + "/config -i -e 's/bare.*=.*true/bare = false/'", d)
+ os.chdir(tmpclonedir)
+ runfetchcmd(ud.basecmd + " reset --hard", d)
+- runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d)
++ runfetchcmd(ud.basecmd + " checkout -f " + ud.revisions[ud.names[0]], d)
+ runfetchcmd(ud.basecmd + " submodule update --init --recursive", d)
+ self._set_relative_paths(tmpclonedir)
+ runfetchcmd("sed " + gitdir + "/config -i -e 's/bare.*=.*false/bare = true/'", d)
+@@ -130,5 +130,16 @@ class GitSM(Git):
+ os.chdir(ud.destdir)
+ submodules = self.uses_submodules(ud, d)
+ if submodules:
++ # Copy also submodule trees from download cache instead of
++ # downloading again from the upstream repository.
++ # For some reason git does not clone them.
++ clone_modules = os.path.join(ud.clonedir, "modules")
++ if os.path.exists(clone_modules):
++ dest_modules = os.path.join(ud.destdir, ".git")
++ runfetchcmd("cp -a " + clone_modules + " " + dest_modules, d)
++
+ runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d)
+- runfetchcmd(ud.basecmd + " submodule update --init --recursive", d)
++ if d.getVar("BB_NO_NETWORK", True) == "1":
++ runfetchcmd(ud.basecmd + " submodule update --no-fetch --init --recursive", d)
++ else:
++ runfetchcmd(ud.basecmd + " submodule update --init --recursive", d)
+--
+1.9.1
+