Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/3] License: dash fix, deb support and ast parse fix
@ 2011-12-10  0:05 Beth Flanagan
  2011-12-10  0:05 ` [PATCH 1/3] license.bbclass: remove bashism Beth Flanagan
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Beth Flanagan @ 2011-12-10  0:05 UTC (permalink / raw)
  To: openembedded-core

Three patches here, one of which requires 4a13766c7b223d.

- Fixed the bashism during license manifest creation.
- Add deb as a valid pkg type for manifest creation. This requires 4a137766c
- Handle LICENSE fields that ast chokes on nicer.

The following changes since commit af7fbd6083f4b5f1770e58fe0a2262951037c176:

  connman: disable ntp support (2011-12-09 19:18:24 +0000)

are available in the git repository at:
  git://git.yoctoproject.org/poky-contrib eflanagan/license_fixes
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=eflanagan/license_fixes

Elizabeth Flanagan (3):
  license.bbclass: remove bashism.
  license.bbclass: remove deb exlusion
  license/copyleft: exception for ast parse

 meta/classes/copyleft_compliance.bbclass |    2 +
 meta/classes/license.bbclass             |   54 +++++++++++++++---------------
 2 files changed, 29 insertions(+), 27 deletions(-)




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] license.bbclass: remove bashism.
  2011-12-10  0:05 [PATCH 0/3] License: dash fix, deb support and ast parse fix Beth Flanagan
@ 2011-12-10  0:05 ` Beth Flanagan
  2011-12-10  0:05 ` [PATCH 2/3] license.bbclass: remove deb exlusion Beth Flanagan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Beth Flanagan @ 2011-12-10  0:05 UTC (permalink / raw)
  To: openembedded-core

From: Elizabeth Flanagan <elizabeth.flanagan@intel.com>

bashism in create_license_manifest removed.

Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
---
 meta/classes/license.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 8c64e4c..e520a4c 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -88,7 +88,7 @@ license_create_manifest() {
                 # 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
+                    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
-- 
1.7.1




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] license.bbclass: remove deb exlusion
  2011-12-10  0:05 [PATCH 0/3] License: dash fix, deb support and ast parse fix Beth Flanagan
  2011-12-10  0:05 ` [PATCH 1/3] license.bbclass: remove bashism Beth Flanagan
@ 2011-12-10  0:05 ` Beth Flanagan
  2011-12-10  0:05 ` [PATCH 3/3] license/copyleft: exception for ast parse Beth Flanagan
  2011-12-10  0:17 ` [PATCH 0/3] License: dash fix, deb support and ast parse fix Richard Purdie
  3 siblings, 0 replies; 5+ messages in thread
From: Beth Flanagan @ 2011-12-10  0:05 UTC (permalink / raw)
  To: openembedded-core

From: Elizabeth Flanagan <elizabeth.flanagan@intel.com>

This commit requires 4a13766c7b223d as it removes the exclusion
of deb package types from license manifest creation.

Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
---
 meta/classes/license.bbclass |   49 +++++++++++++++++++----------------------
 1 files changed, 23 insertions(+), 26 deletions(-)

diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index e520a4c..96fdb46 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -77,34 +77,31 @@ license_create_manifest() {
     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
-    if [ ${IMAGE_PKGTYPE} != "deb" ]; then
-
-        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
+    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
-            done
+            fi
         done
-    fi
+    done
 
     # Two options here:
     # - Just copy the manifest
-- 
1.7.1




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] license/copyleft: exception for ast parse
  2011-12-10  0:05 [PATCH 0/3] License: dash fix, deb support and ast parse fix Beth Flanagan
  2011-12-10  0:05 ` [PATCH 1/3] license.bbclass: remove bashism Beth Flanagan
  2011-12-10  0:05 ` [PATCH 2/3] license.bbclass: remove deb exlusion Beth Flanagan
@ 2011-12-10  0:05 ` Beth Flanagan
  2011-12-10  0:17 ` [PATCH 0/3] License: dash fix, deb support and ast parse fix Richard Purdie
  3 siblings, 0 replies; 5+ messages in thread
From: Beth Flanagan @ 2011-12-10  0:05 UTC (permalink / raw)
  To: openembedded-core

From: Elizabeth Flanagan <elizabeth.flanagan@intel.com>

As the standard for LICENSE format is not well defined, we
may well run into issues where LICENSE cannot be parsed via
ast. In cases like this, we need to warn and continue.

Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
---
 meta/classes/copyleft_compliance.bbclass |    2 ++
 meta/classes/license.bbclass             |    5 ++++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/meta/classes/copyleft_compliance.bbclass b/meta/classes/copyleft_compliance.bbclass
index 5d9ab11..2fe524b 100644
--- a/meta/classes/copyleft_compliance.bbclass
+++ b/meta/classes/copyleft_compliance.bbclass
@@ -48,6 +48,8 @@ def copyleft_should_include(d):
         licenses = oe.license.flattened_licenses(d.getVar('LICENSE', True), choose_licenses)
     except oe.license.InvalidLicense as exc:
         bb.fatal('%s: %s' % (d.getVar('PF', True), exc))
+    except SyntaxError:
+        bb.warn("%s: Failed to parse it's LICENSE field." % (d.getVar('PF', True)))
 
     return all(include_license(lic) for lic in licenses)
 
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 96fdb46..4689aaf 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -231,7 +231,10 @@ python do_populate_lic() {
     try:
         v.visit_string(license_types)
     except oe.license.InvalidLicense as exc:
-        bb.fatal("%s: %s" % (d.getVar('PF', True), exc))
+        bb.fatal('%s: %s' % (d.getVar('PF', True), exc))
+    except SyntaxError:
+        bb.warn("%s: Failed to parse it's LICENSE field." % (d.getVar('PF', True)))
+
 }
 
 SSTATETASKS += "do_populate_lic"
-- 
1.7.1




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] License: dash fix, deb support and ast parse fix
  2011-12-10  0:05 [PATCH 0/3] License: dash fix, deb support and ast parse fix Beth Flanagan
                   ` (2 preceding siblings ...)
  2011-12-10  0:05 ` [PATCH 3/3] license/copyleft: exception for ast parse Beth Flanagan
@ 2011-12-10  0:17 ` Richard Purdie
  3 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2011-12-10  0:17 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Fri, 2011-12-09 at 16:05 -0800, Beth Flanagan wrote:
> Three patches here, one of which requires 4a13766c7b223d.
> 
> - Fixed the bashism during license manifest creation.
> - Add deb as a valid pkg type for manifest creation. This requires 4a137766c
> - Handle LICENSE fields that ast chokes on nicer.
> 
> The following changes since commit af7fbd6083f4b5f1770e58fe0a2262951037c176:
> 
>   connman: disable ntp support (2011-12-09 19:18:24 +0000)
> 
> are available in the git repository at:
>   git://git.yoctoproject.org/poky-contrib eflanagan/license_fixes
>   http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=eflanagan/license_fixes
> 
> Elizabeth Flanagan (3):
>   license.bbclass: remove bashism.
>   license.bbclass: remove deb exlusion
>   license/copyleft: exception for ast parse

Merged to master, thanks.

Richard




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-12-10  0:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-10  0:05 [PATCH 0/3] License: dash fix, deb support and ast parse fix Beth Flanagan
2011-12-10  0:05 ` [PATCH 1/3] license.bbclass: remove bashism Beth Flanagan
2011-12-10  0:05 ` [PATCH 2/3] license.bbclass: remove deb exlusion Beth Flanagan
2011-12-10  0:05 ` [PATCH 3/3] license/copyleft: exception for ast parse Beth Flanagan
2011-12-10  0:17 ` [PATCH 0/3] License: dash fix, deb support and ast parse fix Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox