From 023669c8c27d7b8069e16b9f6a7f8887e8a87007 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 8 Apr 2018 17:09:54 +0200 Subject: [PATCH] deploy-ng: fix absolute exclude patterns, "build" directory exclusion --- direct/src/showutil/dist.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/direct/src/showutil/dist.py b/direct/src/showutil/dist.py index e179b422f4..5b40b7145f 100644 --- a/direct/src/showutil/dist.py +++ b/direct/src/showutil/dist.py @@ -486,17 +486,27 @@ class build_apps(distutils.core.Command): ignore_copy_list += self.exclude_patterns ignore_copy_list += freezer_modpaths ignore_copy_list += self.extra_prc_files - ignore_copy_list = [p3d.GlobPattern(i) for i in ignore_copy_list] + ignore_copy_list = [p3d.GlobPattern(p3d.Filename.from_os_specific(i).get_fullpath()) for i in ignore_copy_list] include_copy_list = [p3d.GlobPattern(i) for i in self.include_patterns] def check_pattern(src, pattern_list): # Normalize file paths across platforms - path = p3d.Filename.from_os_specific(os.path.normpath(src)).get_fullpath() + fn = p3d.Filename.from_os_specific(os.path.normpath(src)) + path = fn.get_fullpath() + fn.make_absolute() + abspath = fn.get_fullpath() + for pattern in pattern_list: - #print('check ignore: {} {} {}'.format(pattern, src, pattern.matches(path))) - if pattern.matches(path): - return True + # If the pattern is absolute, match against the absolute filename. + if pattern.pattern[0] == '/': + #print('check ignore: {} {} {}'.format(pattern, src, pattern.matches(abspath))) + if pattern.matches(abspath): + return True + else: + #print('check ignore: {} {} {}'.format(pattern, src, pattern.matches(path))) + if pattern.matches(path): + return True return False def check_file(fname):