summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-12 16:39:49 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-16 22:13:51 +0100
commit40e1c38dbf636f54175814343c017d42c6f25bf5 (patch)
tree1d003463aa9c22a6cda8f5dd008d5bf46f06d14b /meta/classes
parent57edf5991a80c3714e21408f92d9b9218a54d0ff (diff)
downloadpoky-40e1c38dbf636f54175814343c017d42c6f25bf5.tar.gz
license: Improve disk usage
Currently copies of the license files are made which wastes disk space and adversely affects performance. We can link these instead in most cases for small performance gains. (From OE-Core rev: 0b0f3631fd22f731b6aeedb73965e367b695028b) (From OE-Core rev: fe00d4f479c4fb5e4be5dda616a4de0a257ef6c3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/license.bbclass9
1 files changed, 8 insertions, 1 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 601f5611cc..a34ea39493 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -145,7 +145,14 @@ def copy_license_files(lic_files_paths, destdir):
145 bb.utils.mkdirhier(destdir) 145 bb.utils.mkdirhier(destdir)
146 for (basename, path) in lic_files_paths: 146 for (basename, path) in lic_files_paths:
147 try: 147 try:
148 ret = shutil.copyfile(path, os.path.join(destdir, basename)) 148 src = path
149 dst = os.path.join(destdir, basename)
150 if os.path.exists(dst):
151 os.remove(dst)
152 if (os.stat(src).st_dev == os.stat(destdir).st_dev):
153 os.link(src, dst)
154 else:
155 shutil.copyfile(src, dst)
149 except Exception as e: 156 except Exception as e:
150 bb.warn("Could not copy license file %s: %s" % (basename, e)) 157 bb.warn("Could not copy license file %s: %s" % (basename, e))
151 158