On 11/01/2016 06:09 PM, Richard Purdie wrote:
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?

I should explain why not use oe.path.copytree(), but it was late last
night, so I forgot that. We can't use oe.path.copytree() since:
1) oe.path.copytree() doesn't dereference symlink
2) We need --exclude='.git'

I'd like to add two arguments to oe.path.copytree() to do this if it is worth.

// Robert


Cheers,

Richard

--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to