Patchwork [07/11] classes/license: use "1" to set boolean variables

login
register
mail settings
Submitter Paul Eggleton
Date Nov. 13, 2013, 2:32 p.m.
Message ID <77ca5bc6af846acebf8f0cf28af9724b39de99a5.1384353075.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/61635/
State Accepted
Commit de5f4ffeb662cfadab48e29a5f7d9b595c72184d
Headers show

Comments

Paul Eggleton - Nov. 13, 2013, 2:32 p.m.
The expected usage of COPY_LIC_MANIFEST and COPY_LIC_DIRS appears to be
to set them to "1" to enable; however the test here is just testing
whether they have a value at all, so setting them to "0" would also
enable them which is somewhat disingenuous. Actually check if they are
set to "1" instead in order to fix this.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.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..419105b 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -62,10 +62,10 @@  license_create_manifest() {
 	# - Just copy the manifest
 	# - Copy the manifest and the license directories
 	# With both options set we see a .5 M increase in core-image-minimal
-	if [ -n "${COPY_LIC_MANIFEST}" ]; then
+	if [ "${COPY_LIC_MANIFEST}" = "1" ]; then
 		mkdir -p ${IMAGE_ROOTFS}/usr/share/common-licenses/
 		cp ${LICENSE_MANIFEST} ${IMAGE_ROOTFS}/usr/share/common-licenses/license.manifest
-		if [ -n "${COPY_LIC_DIRS}" ]; then
+		if [ "${COPY_LIC_DIRS}" = "1" ]; then
 			for pkg in ${INSTALLED_PKGS}; do
 				mkdir -p ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg}
 				for lic in `ls ${LICENSE_DIRECTORY}/${pkg}`; do