[oe-commits] Elizabeth Flanagan : license.bbclass: Style guide compliance

git at git.openembedded.org git at git.openembedded.org
Sun Mar 25 11:27:39 UTC 2012


Module: openembedded-core.git
Branch: master
Commit: 0945bf7871fd33df3587cdfb1290b028d7843915
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=0945bf7871fd33df3587cdfb1290b028d7843915

Author: Elizabeth Flanagan <elizabeth.flanagan at intel.com>
Date:   Fri Mar 23 16:51:44 2012 -0700

license.bbclass: Style guide compliance

4 spaces. Correcting some bash whitespace in license to comply
with the style guide.

Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/license.bbclass |  114 +++++++++++++++++++++---------------------
 1 files changed, 57 insertions(+), 57 deletions(-)

diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index eab630e..394a6d4 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -75,63 +75,63 @@ SPDXLICENSEMAP[AFLv1] = "AFL-1.2"
 SPDXLICENSEMAP[EPLv1.0] = "EPL-1.0"
 
 license_create_manifest() {
-    mkdir -p ${LICENSE_DIRECTORY}/${IMAGE_NAME}
-    # Get list of installed packages
-    list_installed_packages | grep -v "locale" |sort > ${LICENSE_DIRECTORY}/${IMAGE_NAME}/package.manifest
-    INSTALLED_PKGS=`cat ${LICENSE_DIRECTORY}/${IMAGE_NAME}/package.manifest`
-    # list of installed packages is broken for deb
-    for pkg in ${INSTALLED_PKGS}; do
-        # not the best way to do this but licenses are not arch dependant iirc
-        files=`find ${TMPDIR}/pkgdata/*/runtime -name ${pkg}| head -1`
-        for filename in $files; do
-            pkged_pn="$(sed -n 's/^PN: //p' ${filename})"
-            pkged_lic="$(sed -n '/^LICENSE: /{ s/^LICENSE: //; s/[+|&()*]/ /g; s/  */ /g; p }' ${filename})"
-            # check to see if the package name exists in the manifest. if so, bail.
-            if ! grep -q "PACKAGE NAME: ${pkg}" ${filename}; then
-                # exclude local recipes
-                if [ ! "${pkged_pn}" = "*locale*" ]; then
-                    echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
-                    echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
-                    echo "LICENSE: " >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
-                    for lic in ${pkged_lic}; do
-                        if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic}" ]; then
-                            echo ${lic}|sed s'/generic_//'g >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
-                        else
-                            echo "WARNING: The license listed, " ${lic} " was not in the licenses collected for " ${pkged_pn}>> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
-                        fi
-                    done
-                    echo "" >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
-                fi
-            fi
-        done
-    done
-
-    # Two options here:
-    # - 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
-        mkdir -p ${IMAGE_ROOTFS}/usr/share/common-licenses/
-        cp ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest ${IMAGE_ROOTFS}/usr/share/common-licenses/license.manifest
-        if [ -n "${COPY_LIC_DIRS}" ]; then
-            for pkg in ${INSTALLED_PKGS}; do
-                mkdir -p ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg}
-                for lic in `ls ${LICENSE_DIRECTORY}/${pkg}`; do
-                    # 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
-                        cp ${LICENSE_DIRECTORY}/${pkg}/${lic} ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg}/${lic}
-                    elif [[ "${lic}" == "generic_"* ]]; then
-                        if [ ! -f ${IMAGE_ROOTFS}/usr/share/common-licenses/${lic} ]; then
-                            cp ${LICENSE_DIRECTORY}/${pkg}/${lic} ${IMAGE_ROOTFS}/usr/share/common-licenses/
-                        fi
-                        ln -s ../${lic} ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg}/${lic}
-                    fi
-                done
-            done
-        fi
-    fi
+	mkdir -p ${LICENSE_DIRECTORY}/${IMAGE_NAME}
+	# Get list of installed packages
+	list_installed_packages | grep -v "locale" |sort > ${LICENSE_DIRECTORY}/${IMAGE_NAME}/package.manifest
+	INSTALLED_PKGS=`cat ${LICENSE_DIRECTORY}/${IMAGE_NAME}/package.manifest`
+	# list of installed packages is broken for deb
+	for pkg in ${INSTALLED_PKGS}; do
+		# not the best way to do this but licenses are not arch dependant iirc
+		files=`find ${TMPDIR}/pkgdata/*/runtime -name ${pkg}| head -1`
+		for filename in $files; do
+			pkged_pn="$(sed -n 's/^PN: //p' ${filename})"
+			pkged_lic="$(sed -n '/^LICENSE: /{ s/^LICENSE: //; s/[+|&()*]/ /g; s/  */ /g; p }' ${filename})"
+			# check to see if the package name exists in the manifest. if so, bail.
+			if ! grep -q "PACKAGE NAME: ${pkg}" ${filename}; then
+				# exclude local recipes
+				if [ ! "${pkged_pn}" = "*locale*" ]; then
+					echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
+					echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
+					echo "LICENSE: " >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
+					for lic in ${pkged_lic}; do
+						if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic}" ]; then
+							echo ${lic}|sed s'/generic_//'g >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
+						else
+							echo "WARNING: The license listed, " ${lic} " was not in the licenses collected for " ${pkged_pn}>> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
+						fi
+					done
+					echo "" >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
+				fi
+			fi
+		done
+	done
+
+	# Two options here:
+	# - 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
+		mkdir -p ${IMAGE_ROOTFS}/usr/share/common-licenses/
+		cp ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest ${IMAGE_ROOTFS}/usr/share/common-licenses/license.manifest
+		if [ -n "${COPY_LIC_DIRS}" ]; then
+			for pkg in ${INSTALLED_PKGS}; do
+				mkdir -p ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg}
+				for lic in `ls ${LICENSE_DIRECTORY}/${pkg}`; do
+					# 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
+						cp ${LICENSE_DIRECTORY}/${pkg}/${lic} ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg}/${lic}
+					elif [[ "${lic}" == "generic_"* ]]; then
+						if [ ! -f ${IMAGE_ROOTFS}/usr/share/common-licenses/${lic} ]; then
+							cp ${LICENSE_DIRECTORY}/${pkg}/${lic} ${IMAGE_ROOTFS}/usr/share/common-licenses/
+						fi
+						ln -s ../${lic} ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg}/${lic}
+					fi
+				done
+			done
+		fi
+	fi
 
 }
 





More information about the Openembedded-commits mailing list