Skip to contentSkip to conversation

meta: fixes for prserver

PATCH Superseded Robert Yang 2 participants 8 messages Oct 20, 2015 – Nov 10, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover meta: fixes for prserver

The following changes since commit 13282223b07787a92c251f89251e8a49a0e4e3eb:

oeqa/runtime: Fix setUp and tearDown methods (2015-10-19 17:55:40 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/prserv
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/prserv

Robert Yang (3):
prserv.bbclass: remove it since it is null prexport.bbclass: avoid export for native and crosssdk
bitbake-prserv-tool: check file name

 meta/classes/package.bbclass  |    1 -
 meta/classes/prexport.bbclass |    5 +++--
 meta/classes/prserv.bbclass   |    2 --
 scripts/bitbake-prserv-tool   |    9 +++++++++
 4 files changed, 12 insertions(+), 5 deletions(-)
 delete mode 100644 meta/classes/prserv.bbclass
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/3 prserv.bbclass: remove it since it is null

---
 meta/classes/package.bbclass |    1 -
 meta/classes/prserv.bbclass  |    2 --
 2 files changed, 3 deletions(-)
 delete mode 100644 meta/classes/prserv.bbclass
meta/classes/package.bbclass +0 -1
index 09230b5..a86b680 100644
@@ -39,7 +39,6 @@
 #    packaging steps
 
 inherit packagedata
-inherit prserv
 inherit chrpath
 
 # Need the package_qa_handle_error() in insane.bbclass
meta/classes/prserv.bbclass deleted +0 -2
deleted file mode 100644
index 139597f..0000000
@@ -1,2 +0,0 @@
-
-
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/3 prexport.bbclass: avoid export for native and crosssdk

In reply to Robert Yang

* The prservice is only used by do_package, the native or crosssdk doesn't have do_package.
* Change WARN to NOTE when no AUTOPR found, the prexport_handler() checks all the parsed recipes, but a lot of them may not be built, for example, the lower version or broken recipes. So change WARN to NOTE to not confuse user.

---
 meta/classes/prexport.bbclass |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/classes/prexport.bbclass +3 -2
index 5a1cb33..809ec10 100644
@@ -8,7 +8,8 @@ PRSERV_DUMPFILE ??= "${PRSERV_DUMPDIR}/prserv.inc"
 
 python prexport_handler () {
     import bb.event
-    if not e.data:
+    if not e.data or bb.data.inherits_class('native', e.data) or \
+        bb.data.inherits_class('crosssdk', e.data):
         return
 
     if isinstance(e, bb.event.RecipeParsed):
@@ -21,7 +22,7 @@ python prexport_handler () {
             bb.fatal("prexport_handler: export failed!")
         (metainfo, datainfo) = retval
         if not datainfo:
-            bb.warn("prexport_handler: No AUTOPR values found for %s" % ver)
+            bb.note("prexport_handler: No AUTOPR values found for %s" % ver)
             return
         oe.prservice.prserv_export_tofile(e.data, None, datainfo, False)
         if 'AUTOINC' in ver:
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/3 bitbake-prserv-tool: check file name

In reply to Robert Yang

Fixed:

$ bitbake-prserv-tool import /tmp/1
  File "/path/to/lib/bb/parse/__init__.py", line 114, in handle(fn='/tmp/1', data=<bb.data_smart.DataSmart object at 0x2369bd0>, include=True):
                     return h['handle'](fn, data, include)
Quoted 1 line

raise ParseError("not a BitBake file", fn)

ParseError: ParseError in /tmp/1: not a BitBake file

But 1.conf works well, its help also shows "<file.conf>", so check the filename and print proper error message.

---
 scripts/bitbake-prserv-tool |    9 +++++++++
 1 file changed, 9 insertions(+)
scripts/bitbake-prserv-tool +9 -0
index 28c2416..dcfd7f2 100755
@@ -86,6 +86,15 @@ do_migrate_localcount ()
 
 [ $# -eq 0 ] && help  && exit 1
 
+case $2 in
+*.conf)
+    ;;
+*)
+    echo ERROR: $2 must end with .conf!
+    exit 1
+    ;;
+esac
+
 case $1 in
 export)
     do_export $2
Signature · 1 line
1.7.9.5
#4 lore raw

Re: [PATCH 3/3] bitbake-prserv-tool: check file name

Quoted 6 lines · Robert Yang

Fixed:

$ bitbake-prserv-tool import /tmp/1
  File "/path/to/lib/bb/parse/__init__.py", line 114, in
handle(fn='/tmp/1', data=<bb.data_smart.DataSmart object at 0x2369bd0>,
include=True):
                     return h['handle'](fn, data, include)
Quoted 7 lines
Quoted 1 line

raise ParseError("not a BitBake file", fn)

ParseError: ParseError in /tmp/1: not a BitBake file

But 1.conf works well, its help also shows "<file.conf>", so check the filename and print proper error message.

This breaks the selftest:

======================================================================
FAIL: test_import_export_override_db
(oeqa.selftest.prservice.BitbakePrTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/decorators.py", line 106, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/prservice.py", line 97, in test_import_export_override_db
self.run_test_pr_export_import('m4', replace_current_db=False)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/prservice.py", line 74, in run_test_pr_export_import
self.assertEqual(export_result.status, 0, msg="PR Service database
export failed: %s" % export_result.output)
AssertionError: 1 != 0 : PR Service database export failed: ERROR:
/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/export.inc must end with .conf!

======================================================================
FAIL: test_import_export_replace_db (oeqa.selftest.prservice.BitbakePrTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/decorators.py", line 106, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/prservice.py", line 93, in test_import_export_replace_db

    self.run_test_pr_export_import('m4')

File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/prservice.py", line 74, in run_test_pr_export_import
self.assertEqual(export_result.status, 0, msg="PR Service database
export failed: %s" % export_result.output)
AssertionError: 1 != 0 : PR Service database export failed: ERROR:
/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/export.inc must end with .conf!

Ross

#5 lore raw

Re: [PATCH 3/3] bitbake-prserv-tool: check file name

Quoted 53 lines · Ross

On 20 October 2015 at 10:25, Robert Yang <[email protected] <mailto:[email protected]>> wrote:

Fixed:
$ bitbake-prserv-tool import /tmp/1
File "/path/to/lib/bb/parse/__init__.py", line 114, in
handle(fn='/tmp/1', data=<bb.data_smart.DataSmart object at 0x2369bd0>, include=True):
return h['handle'](fn, data, include)
> raise ParseError("not a BitBake file", fn)

ParseError: ParseError in /tmp/1: not a BitBake file

But 1.conf works well, its help also shows "<file.conf>", so check the filename and print proper error message.

This breaks the selftest:

======================================================================
FAIL: test_import_export_override_db (oeqa.selftest.prservice.BitbakePrTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/decorators.py", line 106, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/prservice.py", line 97, in test_import_export_override_db
self.run_test_pr_export_import('m4', replace_current_db=False)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/prservice.py", line 74, in run_test_pr_export_import
self.assertEqual(export_result.status, 0, msg="PR Service database export
failed: %s" % export_result.output)
AssertionError: 1 != 0 : PR Service database export failed: ERROR:
/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/export.inc must end with .conf!

======================================================================
FAIL: test_import_export_replace_db (oeqa.selftest.prservice.BitbakePrTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/decorators.py", line 106, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/prservice.py", line 93, in test_import_export_replace_db

     self.run_test_pr_export_import('m4')
Quoted 8 lines

File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/prservice.py", line 74, in run_test_pr_export_import
self.assertEqual(export_result.status, 0, msg="PR Service database export
failed: %s" % export_result.output)
AssertionError: 1 != 0 : PR Service database export failed: ERROR:
/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/export.inc must end with .conf!

Maybe selftest should use export.conf rather than export.inc ?

// Robert

Quoted 2 lines

Ross

#6 lore raw

Re: [PATCH 3/3] bitbake-prserv-tool: check file name

Quoted 2 lines · Robert Yang

Maybe selftest should use export.conf rather than export.inc ?

It's a configuration file that is typically included, so I'd say .inc is perfectly reasonable. Better error reporting in the Python would be useful so it doesn't just throw an exception.

Ross

#7 lore raw

Re: [PATCH 3/3] bitbake-prserv-tool: check file name

Quoted 10 lines · Ross

On 9 November 2015 at 12:43, Robert Yang <[email protected] <mailto:[email protected]>> wrote:

Maybe selftest should use export.conf rather than export.inc ?

It's a configuration file that is typically included, so I'd say .inc is perfectly reasonable. Better error reporting in the Python would be useful so it doesn't just throw an exception.

Thanks, I will update it to both check .inc and .conf.

// Robert

Quoted 2 lines

Ross