diff options
| -rw-r--r-- | bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 29 |
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): | |||
| 218 | logger.debug("localhostbecontroller, our git repos are %s" % pformat(gitrepos)) | 218 | logger.debug("localhostbecontroller, our git repos are %s" % pformat(gitrepos)) |
| 219 | 219 | ||
| 220 | 220 | ||
| 221 | # 2. find checked-out git repos in the sourcedir directory that may help faster cloning | 221 | # 2. Note for future use if the current source directory is a |
| 222 | # checked-out git repos that could match a layer's vcs_url and therefore | ||
| 223 | # be used to speed up cloning (rather than fetching it again). | ||
| 222 | 224 | ||
| 223 | cached_layers = {} | 225 | cached_layers = {} |
| 224 | for ldir in os.listdir(self.be.sourcedir): | 226 | |
| 225 | fldir = os.path.join(self.be.sourcedir, ldir) | 227 | try: |
| 226 | if os.path.isdir(fldir): | 228 | for remotes in self._shellcmd("git remote -v", self.be.sourcedir).split("\n"): |
| 227 | try: | 229 | try: |
| 228 | for line in self._shellcmd("git remote -v", fldir).split("\n"): | 230 | remote = remotes.split("\t")[1].split(" ")[0] |
| 229 | try: | 231 | if remote not in cached_layers: |
| 230 | remote = line.split("\t")[1].split(" ")[0] | 232 | cached_layers[remote] = self.be.sourcedir |
| 231 | if remote not in cached_layers: | 233 | except IndexError: |
| 232 | cached_layers[remote] = fldir | ||
| 233 | except IndexError: | ||
| 234 | pass | ||
| 235 | except ShellCmdException: | ||
| 236 | # ignore any errors in collecting git remotes | ||
| 237 | pass | 234 | pass |
| 235 | except ShellCmdException: | ||
| 236 | # ignore any errors in collecting git remotes this is an optional | ||
| 237 | # step | ||
| 238 | pass | ||
| 239 | |||
| 240 | logger.info("Using pre-checked out source for layer %s", cached_layers) | ||
| 238 | 241 | ||
| 239 | layerlist = [] | 242 | layerlist = [] |
| 240 | 243 | ||
