Skip to content

Commit c004aa8

Browse files
author
Cruz Monrreal
authored
Merge pull request #8303 from theotherjimmy/fix-exclude-paths
Tools: Use logical paths in ignored_dirs
2 parents 8485de9 + 418ca3a commit c004aa8

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

tools/export/gnuarmeclipse/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,6 @@ def compute_exclusions(self):
361361
- recurse the tree and collect all unused folders; descend
362362
the hierarchy only for used nodes
363363
"""
364-
source_folders = [self.filter_dot(s) for s in set(dirname(
365-
src) for src in self.resources.c_sources + self.resources.cpp_sources + self.resources.s_sources)]
366-
367364
self.excluded_folders = set(self.resources.ignored_dirs) - set(self.resources.inc_dirs)
368365

369366

tools/resources/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,8 @@ def add_directory(
379379
base_path = path
380380
if into_path is None:
381381
into_path = path
382-
if self._collect_ignores and path in self.ignored_dirs:
383-
self.ignored_dirs.remove(path)
382+
if self._collect_ignores and relpath(path, base_path) in self.ignored_dirs:
383+
self.ignored_dirs.remove(relpath(path, base_path))
384384
if exclude_paths:
385385
self.add_ignore_patterns(
386386
path, base_path, [join(e, "*") for e in exclude_paths])
@@ -392,7 +392,7 @@ def add_directory(
392392
self._ignoreset.add_mbedignore(
393393
real_base, join(root, IGNORE_FILENAME))
394394

395-
root_path =join(relpath(root, base_path))
395+
root_path = join(relpath(root, base_path))
396396
if self._ignoreset.is_ignored(join(root_path,"")):
397397
self.ignore_dir(root_path)
398398
dirs[:] = []
@@ -407,11 +407,11 @@ def add_directory(
407407
if (any(self._not_current_label(d, t) for t
408408
in self._labels.keys())):
409409
self._label_paths.append((dir_path, base_path, into_path))
410-
self.ignore_dir(dir_path)
410+
self.ignore_dir(relpath(dir_path, base_path))
411411
dirs.remove(d)
412412
elif (d.startswith('.') or d in self._legacy_ignore_dirs or
413413
self._ignoreset.is_ignored(join(root_path, d, ""))):
414-
self.ignore_dir(dir_path)
414+
self.ignore_dir(relpath(dir_path, base_path))
415415
dirs.remove(d)
416416

417417
# Add root to include paths

0 commit comments

Comments
 (0)