mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 15:53:55 -04:00
dist: Check if entire directory should be skipped
This is functionally equivalent, but reduces the message spam in verbose mode, and perhaps is a little faster
This commit is contained in:
parent
adbeea33fb
commit
86937c7bb9
24
direct/src/dist/commands.py
vendored
24
direct/src/dist/commands.py
vendored
@ -983,6 +983,26 @@ class build_apps(setuptools.Command):
|
||||
return check_pattern(fname, include_copy_list) and \
|
||||
not check_pattern(fname, ignore_copy_list)
|
||||
|
||||
def skip_directory(src):
|
||||
# Provides a quick-out for directory checks. NOT recursive.
|
||||
fn = p3d.Filename.from_os_specific(os.path.normpath(src))
|
||||
path = fn.get_fullpath()
|
||||
fn.make_absolute()
|
||||
abspath = fn.get_fullpath()
|
||||
|
||||
for pattern in ignore_copy_list:
|
||||
if not pattern.pattern.endswith('/*') and \
|
||||
not pattern.pattern.endswith('/**'):
|
||||
continue
|
||||
|
||||
if abspath.startswith(pattern_dir + '/'):
|
||||
return True
|
||||
|
||||
if path.startswith(pattern_dir + '/'):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def copy_file(src, dst):
|
||||
src = os.path.normpath(src)
|
||||
dst = os.path.normpath(dst)
|
||||
@ -1023,6 +1043,10 @@ class build_apps(setuptools.Command):
|
||||
rootdir = os.getcwd()
|
||||
for dirname, subdirlist, filelist in os.walk(rootdir):
|
||||
dirpath = os.path.relpath(dirname, rootdir)
|
||||
if skip_directory(dirpath):
|
||||
self.announce('skipping directory {}'.format(dirpath))
|
||||
continue
|
||||
|
||||
for fname in filelist:
|
||||
src = os.path.join(dirpath, fname)
|
||||
dst = os.path.join(builddir, update_path(src))
|
||||
|
Loading…
x
Reference in New Issue
Block a user