Skip to content

Commit 85c0b79

Browse files
marc-hbpdgendt
authored andcommitted
project: fix detection of a previous .west/ at an intermediate level
Fix detection of some existing (and very unlikely) .west/ "pollution" at an intermediate level, for details see first comment at #935 This pollution is very unlikely because it's pretty difficult to have the manifest clone more than one level down before #774 / #854 - so it's difficult to have "intermediate" levels. Signed-off-by: Marc Herbert <Marc.Herbert@gmail.com>
1 parent e4c5bdb commit 85c0b79

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/west/app/project.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,16 @@ def bootstrap(self, args) -> Path:
417417

418418
manifest_abspath = topdir / manifest_path
419419

420+
# We already looked for old .west/ pollution earlier but only at the highest
421+
# topdir/.west level because we didn't know the manifest_path yet. Now that we know
422+
# "manifest_path", look again for any existing, clashing .west/ located at a lower
423+
# level somewhere between the new topdir and the new manifest_path. This check will be
424+
# especially useful once the new --topdir feature is available, see
425+
# https://github.com/zephyrproject-rtos/west/issues/774
426+
already = util.west_topdir(manifest_abspath, fall_back=False)
427+
if not topdir.samefile(already):
428+
self.die_already(already)
429+
420430
# Some filesystems like NTFS can't rename files in use.
421431
# See west issue #558. Will ReFS address this?
422432
ren_delay = args.rename_delay

0 commit comments

Comments
 (0)