Skip to content

Checking if ignored dir is in the dir list before removing #1966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tools/toolchains/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@ def scan_resources(self, path, exclude_paths=None, base_path=None):
(d.startswith('TARGET_') and d[7:] not in labels['TARGET']) or
(d.startswith('TOOLCHAIN_') and d[10:] not in labels['TOOLCHAIN']) or
(d == 'TESTS')):
dirs.remove(d)
if d in dirs:
dirs.remove(d)

if (d.startswith('FEATURE_')):
resources.features[d[8:]] = self.scan_resources(dir_path, base_path=base_path)
Expand All @@ -465,12 +466,13 @@ def scan_resources(self, path, exclude_paths=None, base_path=None):
# to avoid travelling into them and to prevent them
# on appearing in include path.
if self.is_ignored(join(dir_path,"")):
dirs.remove(d)
if d in dirs:
dirs.remove(d)

if exclude_paths:
for exclude_path in exclude_paths:
rel_path = relpath(dir_path, exclude_path)
if not (rel_path.startswith('..')):
if not (rel_path.startswith('..')) and d in dirs:
dirs.remove(d)
break

Expand Down