summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElizabeth Flanagan <elizabeth.flanagan@intel.com>2012-05-30 12:01:15 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-05 23:04:59 +0100
commitfd9f8b97049d787748c0d06f536d7caaacdd3b75 (patch)
treee810a9e147bdf3f38eb7e38f0531809e395053d2
parent0364aee0297aadd5986c6ff221126e4d63cb9a7f (diff)
downloadtizen-distro-fd9f8b97049d787748c0d06f536d7caaacdd3b75.tar.gz
tizen-distro-fd9f8b97049d787748c0d06f536d7caaacdd3b75.tar.bz2
tizen-distro-fd9f8b97049d787748c0d06f536d7caaacdd3b75.zip
license.bbclass: optimize pkg runtime data
This fixes an ugly way I was trying to find pkg runtime data for package and license manifest creation. rootfs generation times for core-image-minimal: Prior to patch real 0m41.570s user 1m40.466s sys 0m6.768s With patch real 0m27.527s user 0m9.833s sys 0m3.496s (From OE-Core rev: 664bbf3207c229eef5ef94a08713a652f33a8466) Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Conflicts: meta/classes/license.bbclass Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/license.bbclass44
1 files changed, 21 insertions, 23 deletions
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index a5374969dc..e6096a65b3 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -86,30 +86,28 @@ license_create_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})"
- 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}" ${filename}; then
- # exclude local recipes
- if [ ! "${pkged_pn}" = "*locale*" ]; then
- echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
- echo "PACKAGE VERSION:" ${pkged_pv} >> ${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
+ filename=`ls ${TMPDIR}/pkgdata/*/runtime/${pkg}| head -1`
+ pkged_pn="$(sed -n 's/^PN: //p' ${filename})"
+ 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}" ${filename}; then
+ # exclude local recipes
+ if [ ! "${pkged_pn}" = "*locale*" ]; then
+ echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest
+ echo "PACKAGE VERSION:" ${pkged_pv} >> ${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
- done
+ fi
done
# Two options here: