From: Mariano Lopez <mariano.lo...@linux.intel.com>

opkg uses empty lines as separator for next package and if an ipk
file was packaged with empty lines in DESCRIPTION opkg won't be
able to handle such ipk file, this happens at execution time.

This commit will add a check for empty lines in DESCRIPTION when
generating to ipk package to avoid this issue.

[YOCTO #10677]

Signed-off-by: Mariano Lopez <mariano.lo...@linux.intel.com>
---
 meta/classes/package_ipk.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index a76b235..a8a4ddc 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -32,6 +32,13 @@ python do_package_ipk () {
         bb.error("Variables incorrectly set, unable to package")
         return
 
+    # opkg won't allow empty lines in package's description at execution
+    # time, so is better to fail at build time instead when trying to install.
+    description = d.getVar('DESCRIPTION').encode('UTF-8', 'ignore')
+    description = description.decode('unicode_escape')
+    if ([line for line in description.splitlines() if not line.strip()]):
+        bb.fatal("opkg won't allow empty lines in DESCRIPTION")
+
     packages = d.getVar('PACKAGES')
     if not packages or packages == '':
         bb.debug(1, "No packages; nothing to do")
-- 
2.6.6

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to