]> code.ossystems Code Review - openembedded-core.git/commitdiff
license.bbclass: use shutil instead of bb.utils.copyfile
authorRoss Burton <ross.burton@intel.com>
Wed, 2 Oct 2013 16:30:21 +0000 (16:30 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 4 Oct 2013 17:25:06 +0000 (18:25 +0100)
bb.utils.copyfile is for a specific purpose and more complicated than needed
here, so just use shutil.copyfile.

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>
meta/classes/license.bbclass

index 0160313e2e1b5b64e1c843ecf06406679eca17d6..6abdae4e84dc4e7b08e379ad036af8d9f61163e0 100644 (file)
@@ -128,12 +128,14 @@ def add_package_and_files(d):
             d.setVar('RRECOMMENDS_' + pn, "%s" % (pn_lic))
 
 def copy_license_files(lic_files_paths, destdir):
+    import shutil
+
     bb.utils.mkdirhier(destdir)
     for (basename, path) in lic_files_paths:
-        ret = bb.utils.copyfile(path, os.path.join(destdir, basename))
-        # If the copy didn't occur, something horrible went wrong and we fail out
-        if not ret:
-            bb.warn("%s could not be copied for some reason. It may not exist. WARN for now." % path)
+        try:
+            ret = shutil.copyfile(path, os.path.join(destdir, basename))
+        except Exception as e:
+            bb.warn("Could not copy license file %s: %s" % (basename, e))
 
 def find_license_files(d):
     """