diff options
author | Vladimir Barinov <vladimir.barinov@cogentembedded.com> | 2017-09-17 00:42:02 +0300 |
---|---|---|
committer | Vladimir Barinov <vladimir.barinov@cogentembedded.com> | 2017-09-17 00:42:02 +0300 |
commit | 281c2865aea51b0ff7c9748d169ee3542ace4679 (patch) | |
tree | c69381934c4e050f3f904896ed3c4e9c5f8f09f9 /meta-rcar-gen3-adas/docs/sample/patch/0003-poky-bitbake-gitsm-fix-BB_NO_NETWORK-build.patch | |
parent | 289fbd4f83543451323d6ce275fad1b5a85b61f1 (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.patch | 47 |
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 + |