From 8eb98d7071c56119c52c3b4f22d7f02a24030bb4 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Fri, 9 Nov 2018 13:11:40 -0600 Subject: [PATCH] Resources: Use path names for ignored dirs ### Description Ignored directories are collected for the sake of exporters that use a blacklist-style approach similar to these build tools. This ignore list will include `/filer/` when exported from the online Compiler. This patch fixes that behavoir. ### Pull request type [x] Fix [ ] Refactor [ ] Target update [ ] Functionality change [ ] Docs update [ ] Test update [ ] Breaking change --- tools/resources/__init__.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/resources/__init__.py b/tools/resources/__init__.py index 17ecc11dc9..34399dc411 100644 --- a/tools/resources/__init__.py +++ b/tools/resources/__init__.py @@ -372,7 +372,7 @@ class Resources(object): root_path = join(relpath(root, base_path)) if self._ignoreset.is_ignored(join(root_path,"")): - self.ignore_dir(root_path) + self.ignore_dir(join(into_path, root_path)) dirs[:] = [] continue @@ -385,11 +385,17 @@ class Resources(object): if (any(self._not_current_label(d, t) for t in self._labels.keys())): self._label_paths.append((dir_path, base_path, into_path)) - self.ignore_dir(relpath(dir_path, base_path)) + self.ignore_dir(join( + into_path, + relpath(dir_path, base_path) + )) dirs.remove(d) elif (d.startswith('.') or d in self._legacy_ignore_dirs or self._ignoreset.is_ignored(join(root_path, d, ""))): - self.ignore_dir(relpath(dir_path, base_path)) + self.ignore_dir(join( + into_path, + relpath(dir_path, base_path) + )) dirs.remove(d) # Add root to include paths @@ -443,12 +449,12 @@ class Resources(object): scanning starting as base_path """ + fake_path = join(into_path, relpath(file_path, base_path)) if (self._ignoreset.is_ignored(relpath(file_path, base_path)) or basename(file_path).startswith(".")): - self.ignore_dir(relpath(file_path, base_path)) + self.ignore_dir(fake_path) return - fake_path = join(into_path, relpath(file_path, base_path)) _, ext = splitext(file_path) file_type = self._EXT.get(ext.lower())