diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/license.bbclass | 44 |
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() { | |||
86 | # list of installed packages is broken for deb | 86 | # list of installed packages is broken for deb |
87 | for pkg in ${INSTALLED_PKGS}; do | 87 | for pkg in ${INSTALLED_PKGS}; do |
88 | # not the best way to do this but licenses are not arch dependant iirc | 88 | # not the best way to do this but licenses are not arch dependant iirc |
89 | files=`find ${TMPDIR}/pkgdata/*/runtime -name ${pkg}| head -1` | 89 | filename=`ls ${TMPDIR}/pkgdata/*/runtime/${pkg}| head -1` |
90 | for filename in $files; do | 90 | pkged_pn="$(sed -n 's/^PN: //p' ${filename})" |
91 | pkged_pn="$(sed -n 's/^PN: //p' ${filename})" | 91 | pkged_lic="$(sed -n '/^LICENSE: /{ s/^LICENSE: //; s/[+|&()*]/ /g; s/ */ /g; p }' ${filename})" |
92 | pkged_lic="$(sed -n '/^LICENSE: /{ s/^LICENSE: //; s/[+|&()*]/ /g; s/ */ /g; p }' ${filename})" | 92 | pkged_pv="$(sed -n 's/^PV: //p' ${filename})" |
93 | pkged_pv="$(sed -n 's/^PV: //p' ${filename})" | 93 | # check to see if the package name exists in the manifest. if so, bail. |
94 | # check to see if the package name exists in the manifest. if so, bail. | 94 | if ! grep -q "PACKAGE NAME: ${pkg}" ${filename}; then |
95 | if ! grep -q "PACKAGE NAME: ${pkg}" ${filename}; then | 95 | # exclude local recipes |
96 | # exclude local recipes | 96 | if [ ! "${pkged_pn}" = "*locale*" ]; then |
97 | if [ ! "${pkged_pn}" = "*locale*" ]; then | 97 | echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest |
98 | echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest | 98 | echo "PACKAGE VERSION:" ${pkged_pv} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest |
99 | echo "PACKAGE VERSION:" ${pkged_pv} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest | 99 | echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest |
100 | echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest | 100 | echo "LICENSE: " >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest |
101 | echo "LICENSE: " >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest | 101 | for lic in ${pkged_lic}; do |
102 | for lic in ${pkged_lic}; do | 102 | if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic}" ]; then |
103 | if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic}" ]; then | 103 | echo ${lic}|sed s'/generic_//'g >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest |
104 | echo ${lic}|sed s'/generic_//'g >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest | 104 | else |
105 | else | 105 | echo "WARNING: The license listed, " ${lic} " was not in the licenses collected for " ${pkged_pn}>> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest |
106 | echo "WARNING: The license listed, " ${lic} " was not in the licenses collected for " ${pkged_pn}>> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest | 106 | fi |
107 | fi | 107 | done |
108 | done | 108 | echo "" >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest |
109 | echo "" >> ${LICENSE_DIRECTORY}/${IMAGE_NAME}/license.manifest | ||
110 | fi | ||
111 | fi | 109 | fi |
112 | done | 110 | fi |
113 | done | 111 | done |
114 | 112 | ||
115 | # Two options here: | 113 | # Two options here: |