mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
deploy-ng: fix absolute exclude patterns, "build" directory exclusion
This commit is contained in:
parent
b0cece7faf
commit
023669c8c2
@ -486,17 +486,27 @@ class build_apps(distutils.core.Command):
|
|||||||
ignore_copy_list += self.exclude_patterns
|
ignore_copy_list += self.exclude_patterns
|
||||||
ignore_copy_list += freezer_modpaths
|
ignore_copy_list += freezer_modpaths
|
||||||
ignore_copy_list += self.extra_prc_files
|
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]
|
include_copy_list = [p3d.GlobPattern(i) for i in self.include_patterns]
|
||||||
|
|
||||||
def check_pattern(src, pattern_list):
|
def check_pattern(src, pattern_list):
|
||||||
# Normalize file paths across platforms
|
# 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:
|
for pattern in pattern_list:
|
||||||
#print('check ignore: {} {} {}'.format(pattern, src, pattern.matches(path)))
|
# If the pattern is absolute, match against the absolute filename.
|
||||||
if pattern.matches(path):
|
if pattern.pattern[0] == '/':
|
||||||
return True
|
#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
|
return False
|
||||||
|
|
||||||
def check_file(fname):
|
def check_file(fname):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user