[oe-commits] [openembedded-core] 05/47: classes/license: fix handling of symlinks pointed to in LIC_FILES_CHKSUM

git at git.openembedded.org git at git.openembedded.org
Wed Nov 16 10:39:09 UTC 2016


rpurdie pushed a commit to branch morty
in repository openembedded-core.

commit 650ddf1d8b687845099a8ac463c3a550a7965095
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Mon Oct 31 16:59:43 2016 +1300

    classes/license: fix handling of symlinks pointed to in LIC_FILES_CHKSUM
    
    If you set LIC_FILES_CHKSUM to point to a relative symlink then you'll
    get "Could not copy license file" warnings in copy_license_files() since
    the symlink won't be valid after it's copied. If the source is a symlink
    then we need to dereference it first.
    
    I encountered this when I used recipetool on the sources for capnproto,
    where the c++ directory contains a LICENSE.txt symlink to the LICENSE
    file in the parent directory, and this symlink ends up being pointed to
    in LIC_FILES_CHKSUM.
    
    (From OE-Core rev: c4d3b1e9c37b920444e53d3231552da18d101882)
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
    Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
 meta/classes/license.bbclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index da4fc3e..660b85f 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -351,6 +351,8 @@ def copy_license_files(lic_files_paths, destdir):
             dst = os.path.join(destdir, basename)
             if os.path.exists(dst):
                 os.remove(dst)
+            if os.path.islink(src):
+                src = os.path.realpath(src)
             canlink = os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev)
             if canlink:
                 try:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list