[yocto] [opkg-utils][PATCH 22/22] opkg.py: improve test so it prints temporary control file with long description and then reads it back

Martin Jansa martin.jansa at gmail.com
Thu Mar 29 15:22:56 PDT 2012


Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
---
 opkg.py |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/opkg.py b/opkg.py
index 2294160..27cbc2a 100644
--- a/opkg.py
+++ b/opkg.py
@@ -509,11 +509,21 @@ if __name__ == "__main__":
     package.set_architecture("arm")
     package.set_maintainer("Testing <testing at testing.testing>")
     package.set_depends("libc")
-    package.set_description("A test of the APIs.")
+    package.set_description("A test of the APIs. And very long descriptions so often used in oe-core\nfoo\n\n\nbar")
 
     print("<")
     sys.stdout.write(str(package))
     print(">")
+    f = open("/tmp/control", "w")
+    f.write(str(package))
+    f.close()
+
+    f = open("/tmp/control", "r")
+    package2 = Package()
+    package2.read_control(f)
+    print("<")
+    sys.stdout.write(str(package2))
+    print(">")
 
     package.write_package("/tmp")
 
-- 
1.7.8.5




More information about the yocto mailing list