diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-10-31 16:59:43 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-11-16 10:37:56 +0000 |
commit | 26e8ebc51103d050253c2ec5af3ef4807d35655b (patch) | |
tree | b401e90c60c79e9b442e2fd89d0f36d998373303 /meta/classes/license.bbclass | |
parent | 874ccd1bb382588040b3ff50cfa88eb1b0df87e7 (diff) | |
download | poky-26e8ebc51103d050253c2ec5af3ef4807d35655b.tar.gz |
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)
(From OE-Core rev: 650ddf1d8b687845099a8ac463c3a550a7965095)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/license.bbclass')
-rw-r--r-- | meta/classes/license.bbclass | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index da4fc3e1d4..660b85f619 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass | |||
@@ -351,6 +351,8 @@ def copy_license_files(lic_files_paths, destdir): | |||
351 | dst = os.path.join(destdir, basename) | 351 | dst = os.path.join(destdir, basename) |
352 | if os.path.exists(dst): | 352 | if os.path.exists(dst): |
353 | os.remove(dst) | 353 | os.remove(dst) |
354 | if os.path.islink(src): | ||
355 | src = os.path.realpath(src) | ||
354 | canlink = os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev) | 356 | canlink = os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev) |
355 | if canlink: | 357 | if canlink: |
356 | try: | 358 | try: |