summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2014-11-12 23:55:58 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-24 17:48:57 +0000
commitebc185186c36fe839008d94dbfb779383df960c7 (patch)
treec9e9877ad01847d8b4bf9657b98714d063f58937
parentdfc99740bd3530baead1703b3a772b17a1c58acc (diff)
downloadopenembedded-core-contrib-ebc185186c36fe839008d94dbfb779383df960c7.tar.gz
openembedded-core-contrib-ebc185186c36fe839008d94dbfb779383df960c7.tar.bz2
openembedded-core-contrib-ebc185186c36fe839008d94dbfb779383df960c7.zip
license.bbclass: hardlink requires write permission
Fixed: * The os.link() reqiures write permission on the src file (suppose the src file belongs to another user, then you need write permission to harlink to it since the link count would change) * Print more info when failed to copy The warning was like: WARNING: Could not copy license file COPYING: [Errno 1] Operation not permitted We couldn't know which recipe print the warning from this message. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/license.bbclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index f85d4f9bcf..d659b767c5 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -150,12 +150,12 @@ def copy_license_files(lic_files_paths, destdir):
dst = os.path.join(destdir, basename)
if os.path.exists(dst):
os.remove(dst)
- if (os.stat(src).st_dev == os.stat(destdir).st_dev):
+ if os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev):
os.link(src, dst)
else:
shutil.copyfile(src, dst)
except Exception as e:
- bb.warn("Could not copy license file %s: %s" % (basename, e))
+ bb.warn("Could not copy license file %s to %s: %s" % (src, dst, e))
def find_license_files(d):
"""