<p dir="ltr">Is this sstate safe?</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Oct 30, 2016 9:11 PM, "Paul Eggleton" <<a href="mailto:paul.eggleton@linux.intel.com">paul.eggleton@linux.intel.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If you set LIC_FILES_CHKSUM to point to a relative symlink then you'll<br>
get "Could not copy license file" warnings in copy_license_files() since<br>
the symlink won't be valid after it's copied. If the source is a symlink<br>
then we need to dereference it first.<br>
<br>
I encountered this when I used recipetool on the sources for capnproto,<br>
where the c++ directory contains a LICENSE.txt symlink to the LICENSE<br>
file in the parent directory, and this symlink ends up being pointed to<br>
in LIC_FILES_CHKSUM.<br>
<br>
Signed-off-by: Paul Eggleton <<a href="mailto:paul.eggleton@linux.intel.com">paul.eggleton@linux.intel.com</a><wbr>><br>
---<br>
meta/classes/license.bbclass | 2 ++<br>
1 file changed, 2 insertions(+)<br>
<br>
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass<br>
index da4fc3e..660b85f 100644<br>
--- a/meta/classes/license.bbclass<br>
+++ b/meta/classes/license.bbclass<br>
@@ -351,6 +351,8 @@ def copy_license_files(lic_files_<wbr>paths, destdir):<br>
dst = os.path.join(destdir, basename)<br>
if os.path.exists(dst):<br>
os.remove(dst)<br>
+ if os.path.islink(src):<br>
+ src = os.path.realpath(src)<br>
canlink = os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev)<br>
if canlink:<br>
try:<br>
--<br>
2.5.5<br>
<br>
--<br>
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</blockquote></div></div>