[OE-core] [PATCH 1/1] oe/copy_buildsystem.py: dereference symlink
Richard Purdie
richard.purdie at linuxfoundation.org
Tue Nov 1 10:09:38 UTC 2016
On Mon, 2016-10-31 at 08:48 -0700, Robert Yang wrote:
> 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()
Could we just use oe.path.copytree() here?
Cheers,
Richard
More information about the Openembedded-core
mailing list