Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 9ED2AE01107; Thu, 8 Oct 2015 04:09:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.220.51 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 6FECCE00EE7 for ; Thu, 8 Oct 2015 04:09:32 -0700 (PDT) Received: by pablk4 with SMTP id lk4so52290811pab.3 for ; Thu, 08 Oct 2015 04:09:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=cJZSe0MPkeP/z7iNmI56VOOAYSv2M9/Du4jdyP0E4fA=; b=crzeM6zINC+VobhN1QZ2G/RsPmEX0Yhk+pKHVMdSQ1Vv0EKHau4iAtL9py2Vs1KfCb dWFz4dsCio+zYY1Sa7cQbHHFfu5Sidz9zstgO4kkEb09sTsfBo+75Pa4/lchZOUKumeM zAJdNANN9FW8dHyN+lgctNtR2pWySVYSirvKK4XoBab6EVWLqLAlg099PHSQCVcSKEYU jyrkamHlrh50qj4NzjdkIf3sWCKRKQOb++g/IiRRbjc6m6dUsIX+919ghNhk6oHJSESD qleQyhdFyYjTJ03njj6DRE2XEaT9FA1pOrrIT5oI9rJanvSRMKR24xoiABM0TXQDIzeC UZGg== X-Gm-Message-State: ALoCoQkSWQwYC8m2GZe94/mEEUgX6n2uHKVzwJNMlYxw1F0+nBJljasd/1xSrNnJSasQLZS2jj+d X-Received: by 10.68.111.3 with SMTP id ie3mr7605763pbb.63.1444302572651; Thu, 08 Oct 2015 04:09:32 -0700 (PDT) Received: from draco.ger.corp.intel.com ([192.55.54.43]) by smtp.gmail.com with ESMTPSA id pq4sm32844181pbc.53.2015.10.08.04.09.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Oct 2015 04:09:32 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 8 Oct 2015 12:08:20 +0100 Message-Id: <1444302500-5280-1-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.4 Subject: [PATCH] toaster: localhostbectrl Don't descend into directories for cached_layers X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2015 11:09:38 -0000 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 step is cached_layers and previously traversed through 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] Signed-off-by: Michael Wood --- .../toaster/bldcontrol/localhostbecontroller.py | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py index 3ee68ae..b5cf559 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 = [] -- 2.1.4