conf/layer.conf: Update LAYERSERIES_COMPAT to warrior
[meta-ossystems-base.git] / classes / deploy-license-manifest.bbclass
1 ROOTFS_POSTPROCESS_COMMAND += "deploy_license_manifest;"
2 IMAGE_POSTPROCESS_COMMAND += "link_license_manifest;"
3
4 deploy_license_manifest () {
5     if [ -e "${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest" ]; then
6         cp ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest ${IMGDEPLOYDIR}/${IMAGE_NAME}.license_manifest
7         sed -n '/PACKAGE NAME/{: start; /^ *$/b done; /LICENSE:/{s/: /: "/; s/$/"/;}; s/^.*://; H; n; b start; : done; x; s/^[\n ]*//; s/ *\n */,/g; p}' ${IMGDEPLOYDIR}/${IMAGE_NAME}.license_manifest >${IMGDEPLOYDIR}/${IMAGE_NAME}.license_manifest.csv
8     fi
9 }
10
11 link_license_manifest () {
12     if [ -e "${IMGDEPLOYDIR}/${IMAGE_NAME}.license_manifest" ]; then
13         ln -sf ${IMAGE_NAME}.license_manifest ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.license_manifest
14         ln -sf ${IMAGE_NAME}.license_manifest.csv ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.license_manifest.csv
15     fi
16 }