Patchwork [5/6] classes/license: correct license info in lisense.manifest

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

Comments

Vladimir Zapolskiy - Sept. 11, 2012, 1:18 a.m.
Trivial change, do not cut off plus symbol from license name, otherwise
information about package license is corrupted.

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

Patch

diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 74a8306..4b5954d 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -103,10 +103,10 @@  license_create_manifest() {
 
 		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})"
+		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})"
+			pkged_lic="$(sed -n "/^LICENSE: /{ s/^LICENSE: //; s/[|&()*]/ /g; s/  */ /g; p }" ${filename})"
 		fi
 
 		echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_MANIFEST}
@@ -114,8 +114,9 @@  license_create_manifest() {
 		echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_MANIFEST}
 		echo "LICENSE: " >> ${LICENSE_MANIFEST}
 		for lic in ${pkged_lic}; do
-			if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic}" ]; then
-				echo ${lic}|sed s'/generic_//'g >> ${LICENSE_MANIFEST}
+			# to reference a license file trim trailing + symbol
+			if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic%+}" ]; then
+				echo ${lic} >> ${LICENSE_MANIFEST}
 			else
 				echo "WARNING: The license listed, " ${lic} " was not in the licenses collected for " ${pkged_pn} >> ${LICENSE_MANIFEST}
 			fi