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-25 08:18:13 +0000
commitbcc548c750fb665b1ee3ca96c421e097804b2f67 (patch)
treee39c95fa260e0275eaa15d544e64417a9d3c584e
parentccd2f54d5e0361314eaa96774404e8ba8f10ae65 (diff)
downloadpoky-bcc548c750fb665b1ee3ca96c421e097804b2f67.tar.gz
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. (From OE-Core rev: ebc185186c36fe839008d94dbfb779383df960c7) 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):
150 dst = os.path.join(destdir, basename) 150 dst = os.path.join(destdir, basename)
151 if os.path.exists(dst): 151 if os.path.exists(dst):
152 os.remove(dst) 152 os.remove(dst)
153 if (os.stat(src).st_dev == os.stat(destdir).st_dev): 153 if os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev):
154 os.link(src, dst) 154 os.link(src, dst)
155 else: 155 else:
156 shutil.copyfile(src, dst) 156 shutil.copyfile(src, dst)
157 except Exception as e: 157 except Exception as e:
158 bb.warn("Could not copy license file %s: %s" % (basename, e)) 158 bb.warn("Could not copy license file %s to %s: %s" % (src, dst, e))
159 159
160def find_license_files(d): 160def find_license_files(d):
161 """ 161 """