Patchwork [v2,4/4] license.bbclass: include all licenses in the manifest

login
register
mail settings
Submitter Christopher Larson
Date June 10, 2013, 11:15 p.m.
Message ID <03a26f0a33de866401325c100eae7baadf62e6c2.1370906102.git.chris_larson@mentor.com>
Download mbox | patch
Permalink /patch/51479/
State New
Headers show

Comments

Christopher Larson - June 10, 2013, 11:15 p.m.
From: Christopher Larson <chris_larson@mentor.com>

When we don't have a generic license file for the license in question, we can
warn, but we should still include it in the manifest, otherwise the manifest
doesn't reflect reality. Failing to include a license listed in the recipe in
the manifest can't be allowed.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
---
 meta/classes/license.bbclass | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
Otavio Salvador - June 10, 2013, 11:56 p.m.
On Mon, Jun 10, 2013 at 8:15 PM, Christopher Larson <kergoth@gmail.com>wrote:

> From: Christopher Larson <chris_larson@mentor.com>
>
> When we don't have a generic license file for the license in question, we
> can
> warn, but we should still include it in the manifest, otherwise the
> manifest
> doesn't reflect reality. Failing to include a license listed in the recipe
> in
> the manifest can't be allowed.
>
> Signed-off-by: Christopher Larson <chris_larson@mentor.com>
>

Reviewed-by: Otavio Salvador <otavio@ossystems.com.br>

Patch

diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 76749c4..2ca47cc 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -51,11 +51,10 @@  license_create_manifest() {
 		printf "LICENSE:" >> ${LICENSE_MANIFEST}
 		for lic in ${pkged_lic}; do
 			# to reference a license file trim trailing + symbol
-			if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic%+}" ]; then
-				printf " ${lic}" >> ${LICENSE_MANIFEST}
-			else
-				echo "WARNING: The license listed ${lic} was not in the licenses collected for ${pkged_pn}"
+			if ! [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic%+}" ]; then
+				bbwarn "The license listed ${lic} was not in the licenses collected for ${pkged_pn}"
 			fi
+                        printf " ${lic}" >> ${LICENSE_MANIFEST}
 		done
 		printf "\n\n" >> ${LICENSE_MANIFEST}
 	done