]> code.ossystems Code Review - openembedded-core.git/commit
oe/copy_buildsystem.py: dereference symlink
authorRobert Yang <liezhi.yang@windriver.com>
Mon, 31 Oct 2016 15:48:58 +0000 (08:48 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 16 Nov 2016 10:33:33 +0000 (10:33 +0000)
commit51d3cab8aab593481be16cadaca6fcddbb64bc52
tree182fa61d33e433cb92f43e65a66ff66fa282ba6c
parent9ab0cba49d9ab67aacfcfb47689f4a77a72a0866
oe/copy_buildsystem.py: dereference symlink

When there is a relative symlink in the layer, for example:
symA -> ../out/of/layer/file

symA will be invalid fater copied, it would be invalid from build time
if it points to a relative path, and would be invalid after extracted
the sdk if it points to a absolute py. Dereference symlink when copy
will fix the problem.

Use tar rather than shutil.copytree() to copy is because:
1) shutil.copytree(symlinks=Fasle) has bugs when dereference symlinks:
   https://bugs.python.org/issue21697
   And Ubunutu 1404 doesn't upgrade python3 to fix the problem.

2) shutil.copytree(symlinks=False) raises errors when there is a invalid
   symlink, and tar just prints a warning, tar is preferred here since
   the real world is unpredicatable

3) tar is faster than shutil.copytree() as said by oe.path.copytree()

So use tar to copy.

(From OE-Core rev: f4d70bb0882eec4fb46cd942f2796fad57c72982)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/lib/oe/copy_buildsystem.py