Skip to content
Snippets Groups Projects
Commit 13aaf1df authored by Lukas Stadler's avatar Lukas Stadler
Browse files

handle symlinks in the lib directory when creating the release distribution

parent b85e0db2
Branches
No related tags found
No related merge requests found
...@@ -80,12 +80,31 @@ class ReleaseBuildTask(mx.NativeBuildTask): ...@@ -80,12 +80,31 @@ class ReleaseBuildTask(mx.NativeBuildTask):
# copy the release directories # copy the release directories
output_dir = self.subject.dir output_dir = self.subject.dir
fastr_dir = mx_fastr._fastr_suite.dir fastr_dir = mx_fastr._fastr_suite.dir
for d in ['bin', 'include', 'lib', 'library', 'etc', 'share', 'doc']: for d in ['bin', 'include', 'library', 'etc', 'share', 'doc']:
target_dir = join(output_dir, d) target_dir = join(output_dir, d)
if os.path.exists(target_dir): if os.path.exists(target_dir):
print("delete " + target_dir)
shutil.rmtree(target_dir) shutil.rmtree(target_dir)
print("copy from " + join(fastr_dir, d) + " to " + target_dir)
shutil.copytree(join(fastr_dir, d), target_dir) shutil.copytree(join(fastr_dir, d), target_dir)
lib_fastr_dir = join(fastr_dir, 'lib')
lib_output_dir = join(output_dir, 'lib')
if os.path.exists(lib_output_dir):
print("delete " + lib_output_dir)
shutil.rmtree(lib_output_dir)
os.mkdir(lib_output_dir)
for f in os.listdir(lib_fastr_dir):
source_file = join(lib_fastr_dir, f)
target_file = join(lib_output_dir, f)
if f != '.DS_Store':
if os.path.islink(source_file):
print("copy from " + join(lib_fastr_dir, f) + " to " + target_file)
os.symlink(os.readlink(source_file), target_file)
else:
print("copy from " + join(lib_fastr_dir, f) + " to " + target_file)
shutil.copy(source_file, target_file)
# copyrights # copyrights
copyrights_dir = join(fastr_dir, 'mx.fastr', 'copyrights') copyrights_dir = join(fastr_dir, 'mx.fastr', 'copyrights')
with open(join(output_dir, 'COPYRIGHT'), 'w') as outfile: with open(join(output_dir, 'COPYRIGHT'), 'w') as outfile:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment