aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-10-09 11:28:58 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-11 08:12:58 +0100
commite35c404537db0b46047fcb2ee7d3645e3e0935c5 (patch)
treeff2476a03d3e28dbc454ec2510160cd26cfcd870 /bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
parentd9528d9a394a45ecc2abb945cbffcf31b0078207 (diff)
downloadopenembedded-core-contrib-e35c404537db0b46047fcb2ee7d3645e3e0935c5.tar.gz
bitbake: toaster: Don't descend into directories for cached_layers
As toaster makes use of clones of itself we have a mechanism to just clone the current checkout and use that as a basis for the git clone for the layers inside. For instance, in poky, if we're running in that directory, we don't ever want to change the current checkout so we make a copy of ourselves to do this work in. This steps through cached_layers and previously-traversed directories inside the current checkout to find any pre-existing checkouts. This was ending up traversing too many directories down, so remove the traverse and only deal with the current directory. [YOCTO #8463] (Bitbake rev: 9c40b3b6377ab8f5d6ac9b8e00585b71de00bf74) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/localhostbecontroller.py')
-rw-r--r--bitbake/lib/toaster/bldcontrol/localhostbecontroller.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
index 3ee68ae47a..b5cf5591fd 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -218,23 +218,26 @@ class LocalhostBEController(BuildEnvironmentController):
logger.debug("localhostbecontroller, our git repos are %s" % pformat(gitrepos))
- # 2. find checked-out git repos in the sourcedir directory that may help faster cloning
+ # 2. Note for future use if the current source directory is a
+ # checked-out git repos that could match a layer's vcs_url and therefore
+ # be used to speed up cloning (rather than fetching it again).
cached_layers = {}
- for ldir in os.listdir(self.be.sourcedir):
- fldir = os.path.join(self.be.sourcedir, ldir)
- if os.path.isdir(fldir):
+
+ try:
+ for remotes in self._shellcmd("git remote -v", self.be.sourcedir).split("\n"):
try:
- for line in self._shellcmd("git remote -v", fldir).split("\n"):
- try:
- remote = line.split("\t")[1].split(" ")[0]
- if remote not in cached_layers:
- cached_layers[remote] = fldir
- except IndexError:
- pass
- except ShellCmdException:
- # ignore any errors in collecting git remotes
+ remote = remotes.split("\t")[1].split(" ")[0]
+ if remote not in cached_layers:
+ cached_layers[remote] = self.be.sourcedir
+ except IndexError:
pass
+ except ShellCmdException:
+ # ignore any errors in collecting git remotes this is an optional
+ # step
+ pass
+
+ logger.info("Using pre-checked out source for layer %s", cached_layers)
layerlist = []