summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2013-10-02 16:30:21 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-04 18:26:51 +0100
commit9def5c95425d6c49ca0b908573fb82d1b67e86ea (patch)
treec765c1b4e0f6231af06d7e22db4712da009e25e0
parent2a013e290dcc91832c36047520259592b1d61a48 (diff)
downloadpoky-9def5c95425d6c49ca0b908573fb82d1b67e86ea.tar.gz
license.bbclass: use shutil instead of bb.utils.copyfile
bb.utils.copyfile is for a specific purpose and more complicated than needed here, so just use shutil.copyfile. (From OE-Core rev: dc81df215cc94c279991df35125d94770a1bc3d2) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/license.bbclass10
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 0160313e2e..6abdae4e84 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -128,12 +128,14 @@ def add_package_and_files(d):
128 d.setVar('RRECOMMENDS_' + pn, "%s" % (pn_lic)) 128 d.setVar('RRECOMMENDS_' + pn, "%s" % (pn_lic))
129 129
130def copy_license_files(lic_files_paths, destdir): 130def copy_license_files(lic_files_paths, destdir):
131 import shutil
132
131 bb.utils.mkdirhier(destdir) 133 bb.utils.mkdirhier(destdir)
132 for (basename, path) in lic_files_paths: 134 for (basename, path) in lic_files_paths:
133 ret = bb.utils.copyfile(path, os.path.join(destdir, basename)) 135 try:
134 # If the copy didn't occur, something horrible went wrong and we fail out 136 ret = shutil.copyfile(path, os.path.join(destdir, basename))
135 if not ret: 137 except Exception as e:
136 bb.warn("%s could not be copied for some reason. It may not exist. WARN for now." % path) 138 bb.warn("Could not copy license file %s: %s" % (basename, e))
137 139
138def find_license_files(d): 140def find_license_files(d):
139 """ 141 """