if build_dir:
root = os.path.realpath(os.path.abspath(find_root_package_dir(m.sources[0])))
def copy_to_build_dir(filepath, root=root):
- filepath = os.path.abspath(filepath)
- if os.path.realpath(filepath).startswith(root):
- mod_dir = os.path.join(
- build_dir, os.path.dirname(_relpath(filepath)))
+ filepath = os.path.realpath(os.path.abspath(filepath))
+ if filepath.startswith(root):
+ mod_dir = os.path.join(build_dir,
+ os.path.dirname(_relpath(filepath, root)))
if not os.path.isdir(mod_dir):
os.makedirs(mod_dir)
shutil.copy(filepath, mod_dir)