summaryrefslogtreecommitdiff
path: root/meta/classes/license.bbclass
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>2012-09-11 04:13:45 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-12 14:44:55 +0100
commit100e457de4b223defb1a844d3b85af812caf2f79 (patch)
treea81b6bff50c3d3af72a8f20a991a26384a190b7a /meta/classes/license.bbclass
parent0d3ca97d3a349ca572fce798ebf9de59a438c0c8 (diff)
downloadopenembedded-core-100e457de4b223defb1a844d3b85af812caf2f79.tar.gz
openembedded-core-100e457de4b223defb1a844d3b85af812caf2f79.tar.bz2
openembedded-core-100e457de4b223defb1a844d3b85af812caf2f79.zip
classes/license: remove redundant nested if statements
Cosmetic change, which improves code perception. Also check for locale packages firstly, this shall improve performance a little. Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/classes/license.bbclass')
-rw-r--r--meta/classes/license.bbclass40
1 files changed, 23 insertions, 17 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 021ab2ee17..8fb66be502 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -90,26 +90,32 @@ license_create_manifest() {
# not the best way to do this but licenses are not arch dependant iirc
filename=`ls ${TMPDIR}/pkgdata/*/runtime-reverse/${pkg}| head -1`
pkged_pn="$(sed -n 's/^PN: //p' ${filename})"
+
+ # exclude locale recipes
+ if [ "${pkged_pn}" = "*locale*" ]; then
+ continue
+ fi
+
+ # check to see if the package name exists in the manifest. if so, bail.
+ if grep -q "^PACKAGE NAME: ${pkg}" ${LICENSE_MANIFEST}; then
+ continue
+ fi
+
pkged_lic="$(sed -n '/^LICENSE: /{ s/^LICENSE: //; s/[+|&()*]/ /g; s/ */ /g; p }' ${filename})"
pkged_pv="$(sed -n 's/^PV: //p' ${filename})"
- # check to see if the package name exists in the manifest. if so, bail.
- if ! grep -q "^PACKAGE NAME: ${pkg}" ${LICENSE_MANIFEST}; then
- # exclude local recipes
- if [ ! "${pkged_pn}" = "*locale*" ]; then
- echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_MANIFEST}
- echo "PACKAGE VERSION:" ${pkged_pv} >> ${LICENSE_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}
- else
- echo "WARNING: The license listed, " ${lic} " was not in the licenses collected for " ${pkged_pn} >> ${LICENSE_MANIFEST}
- fi
- done
- echo "" >> ${LICENSE_MANIFEST}
+
+ echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_MANIFEST}
+ echo "PACKAGE VERSION:" ${pkged_pv} >> ${LICENSE_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}
+ else
+ echo "WARNING: The license listed, " ${lic} " was not in the licenses collected for " ${pkged_pn} >> ${LICENSE_MANIFEST}
fi
- fi
+ done
+ echo "" >> ${LICENSE_MANIFEST}
done
# Two options here: