Patchwork [1/1] license.bbclass: fix missing of license files on ubuntu build host

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date Nov. 18, 2013, 7:20 a.m.
Message ID <514cc82b549f3ee3a62b43616ef4813635bec4b7.1384759192.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/61891/
State New
Headers show

Comments

Qi.Chen@windriver.com - Nov. 18, 2013, 7:20 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

The license_create_manifest function contains bashism, this will lead
to unexpected results on ubuntu build host, as sh is linked to dash on
ubuntu. Even if COPY_LIC_MANIFEST and COPY_LIC_DIRS are enabled, the
license files will still be missing on target.

This patch fixes the above problem.

[YOCTO #5549]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/classes/license.bbclass |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 1c1b679..34ae704 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -72,9 +72,9 @@  license_create_manifest() {
 					# Really don't need to copy the generics as they're 
 					# represented in the manifest and in the actual pkg licenses
 					# Doing so would make your image quite a bit larger
-					if [[ "${lic}" != "generic_"* ]]; then
+					if [ "${lic#generic_}" = "${lic}" ]; then
 						cp ${LICENSE_DIRECTORY}/${pkg}/${lic} ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg}/${lic}
-					elif [[ "${lic}" == "generic_"* ]]; then
+					else
 						if [ ! -f ${IMAGE_ROOTFS}/usr/share/common-licenses/${lic} ]; then
 							cp ${LICENSE_DIRECTORY}/${pkg}/${lic} ${IMAGE_ROOTFS}/usr/share/common-licenses/
 						fi