python/boost: use shutil.copytree()

This commit is contained in:
Max Kellermann 2015-12-16 00:05:17 +01:00
parent 9bc0fada5c
commit cb1e644230
1 changed files with 3 additions and 11 deletions

View File

@ -18,14 +18,6 @@ class BoostProject(Project):
# install the headers manually; don't build any library # install the headers manually; don't build any library
# (because right now, we only use header-only libraries) # (because right now, we only use header-only libraries)
includedir = os.path.join(toolchain.install_prefix, 'include') includedir = os.path.join(toolchain.install_prefix, 'include')
for dirpath, dirnames, filenames in os.walk(os.path.join(src, 'boost')): dest = os.path.join(includedir, 'boost')
relpath = dirpath[len(src)+1:] shutil.rmtree(dest, ignore_errors=True)
destdir = os.path.join(includedir, relpath) shutil.copytree(os.path.join(src, 'boost'), dest)
try:
os.mkdir(destdir)
except:
pass
for name in filenames:
if name[-4:] == '.hpp':
shutil.copyfile(os.path.join(dirpath, name),
os.path.join(destdir, name))