aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
diff options
context:
space:
mode:
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 = []