Patchwork [4/6] classes/license: account LICENSE_${pkg} values in manifest

login
register
mail settings
Submitter Vladimir Zapolskiy
Date Sept. 11, 2012, 1:18 a.m.
Message ID <1347326296-32657-1-git-send-email-vladimir_zapolskiy@mentor.com>
Download mbox | patch
Permalink /patch/36243/
State Accepted
Commit 8fd734e6f9159921d0d148c4d5c0fa37c882b21a
Headers show

Comments

Vladimir Zapolskiy - Sept. 11, 2012, 1:18 a.m.
Trivial change, process LICENSE_${pkg} and LICENSE values. This fixes multiple
cases, when license is not specified at all in license.manifest

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
---
 meta/classes/license.bbclass |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 8fb66be..74a8306 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -101,8 +101,13 @@  license_create_manifest() {
 			continue
 		fi
 
-		pkged_lic="$(sed -n '/^LICENSE: /{ s/^LICENSE: //; s/[+|&()*]/ /g; s/  */ /g; p }' ${filename})"
 		pkged_pv="$(sed -n 's/^PV: //p' ${filename})"
+		pkged_name="$(basename $(readlink ${filename}))"
+		pkged_lic="$(sed -n "/^LICENSE_${pkged_name}: /{ s/^LICENSE_${pkged_name}: //; s/[+|&()*]/ /g; s/  */ /g; p }" ${filename})"
+		if [ -z ${pkged_lic} ]; then
+			# fallback checking value of LICENSE
+			pkged_lic="$(sed -n "/^LICENSE: /{ s/^LICENSE: //; s/[+|&()*]/ /g; s/  */ /g; p }" ${filename})"
+		fi
 
 		echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_MANIFEST}
 		echo "PACKAGE VERSION:" ${pkged_pv} >> ${LICENSE_MANIFEST}