From 900711acd09de58c09a9c5a1d185d36e3f217035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Thu, 30 Jan 2020 12:53:29 -0800 Subject: [PATCH] west update: don't update projects twice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Track which projects we've already updated via update_importer() and don't do it twice if it's already done. Signed-off-by: Martí Bolívar --- src/west/app/project.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/west/app/project.py b/src/west/app/project.py index d16aaa0..d152ec4 100644 --- a/src/west/app/project.py +++ b/src/west/app/project.py @@ -641,22 +641,31 @@ class Update(_ProjectCommand): # call our importer whenever it encounters an import statement # in a project, allowing us to control the recursion so it # always uses the latest manifest data. + self.updated = set() manifest = Manifest.from_file(importer=self.update_importer, import_flags=ImportFlag.FORCE_PROJECTS) failed = [] for project in manifest.projects: - if isinstance(project, ManifestProject): + if (isinstance(project, ManifestProject) or + project.name in self.updated): continue try: self.update(project) + self.updated.add(project.name) except subprocess.CalledProcessError: failed.append(project) self._handle_failed(args, failed) def update_importer(self, project, path): - self.update(project) + if isinstance(project, ManifestProject): + if not project.is_cloned(): + log.die("manifest repository {project.abspath} was deleted") + else: + self.update(project) + self.updated.add(project.name) + try: return _manifest_content_at(project, path) except FileNotFoundError: