All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] bitbake-dumpsig: Make --task work again
@ 2018-11-14  1:01 Peter Kjellerstedt
  2018-11-14  1:01 ` [PATCH 2/2] bitbake-dumpsig: Change to use argparse Peter Kjellerstedt
  2018-11-14  1:33 ` ✗ patchtest: failure for "bitbake-dumpsig: Make --task w..." and 1 more Patchwork
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Kjellerstedt @ 2018-11-14  1:01 UTC (permalink / raw)
  To: openembedded-core

This corresponds to commit fdcea991 that fixed the --task option for
bitbake-diffsigs.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 bitbake/bin/bitbake-dumpsig | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)

diff --git a/bitbake/bin/bitbake-dumpsig b/bitbake/bin/bitbake-dumpsig
index 95ebd93546..40e08e0439 100755
--- a/bitbake/bin/bitbake-dumpsig
+++ b/bitbake/bin/bitbake-dumpsig
@@ -3,7 +3,8 @@
 # bitbake-dumpsig
 # BitBake task signature dump utility
 #
-# Copyright (C) 2013 Intel Corporation
+# Copyright (C) 2013, 2017 Intel Corporation
+# Copyright (C) 2017-2018 Axis Communications AB
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License version 2 as
@@ -33,17 +34,38 @@ import bb.msg
 
 logger = bb.msg.logger_create('bitbake-dumpsig')
 
+def find_siginfo(tinfoil, pn, taskname, sigs=None):
+    result = None
+    tinfoil.set_event_mask(['bb.event.FindSigInfoResult',
+                            'logging.LogRecord',
+                            'bb.command.CommandCompleted',
+                            'bb.command.CommandFailed'])
+    ret = tinfoil.run_command('findSigInfo', pn, taskname, sigs)
+    if ret:
+        while True:
+            event = tinfoil.wait_event(1)
+            if event:
+                if isinstance(event, bb.command.CommandCompleted):
+                    break
+                elif isinstance(event, bb.command.CommandFailed):
+                    logger.error(str(event))
+                    sys.exit(2)
+                elif isinstance(event, bb.event.FindSigInfoResult):
+                    result = event.result
+                elif isinstance(event, logging.LogRecord):
+                    logger.handle(event)
+    else:
+        logger.error('No result returned from findSigInfo command')
+        sys.exit(2)
+    return result
+
 def find_siginfo_task(bbhandler, pn, taskname):
     """ Find the most recent signature file for the specified PN/task """
 
-    if not hasattr(bb.siggen, 'find_siginfo'):
-        logger.error('Metadata does not support finding signature data files')
-        sys.exit(1)
-
     if not taskname.startswith('do_'):
         taskname = 'do_%s' % taskname
 
-    filedates = bb.siggen.find_siginfo(pn, taskname, None, bbhandler.config_data)
+    filedates = find_siginfo(bbhandler, pn, taskname)
     latestfiles = sorted(filedates.keys(), key=lambda f: filedates[f])[-1:]
     if not latestfiles:
         logger.error('No sigdata files found matching %s %s' % (pn, taskname))
-- 
2.12.0



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

* [PATCH 2/2] bitbake-dumpsig: Change to use argparse
  2018-11-14  1:01 [PATCH 1/2] bitbake-dumpsig: Make --task work again Peter Kjellerstedt
@ 2018-11-14  1:01 ` Peter Kjellerstedt
  2018-11-14  1:33 ` ✗ patchtest: failure for "bitbake-dumpsig: Make --task w..." and 1 more Patchwork
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Kjellerstedt @ 2018-11-14  1:01 UTC (permalink / raw)
  To: openembedded-core

This corresponds to commit 7f130e0b for bitbake-diffsigs.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 bitbake/bin/bitbake-dumpsig | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/bitbake/bin/bitbake-dumpsig b/bitbake/bin/bitbake-dumpsig
index 40e08e0439..50e5717ace 100755
--- a/bitbake/bin/bitbake-dumpsig
+++ b/bitbake/bin/bitbake-dumpsig
@@ -22,7 +22,7 @@
 import os
 import sys
 import warnings
-import optparse
+import argparse
 import logging
 import pickle
 
@@ -73,21 +73,22 @@ def find_siginfo_task(bbhandler, pn, taskname):
 
     return latestfiles[0]
 
-parser = optparse.OptionParser(
-    description = "Dumps siginfo/sigdata files written out by BitBake",
-    usage = """
-  %prog -t recipename taskname
-  %prog sigdatafile""")
+parser = argparse.ArgumentParser(
+    description="Dump siginfo/sigdata files written out by BitBake")
 
-parser.add_option("-D", "--debug",
-        help = "enable debug",
-        action = "store_true", dest="debug", default = False)
+parser.add_argument('-d', '--debug',
+                    help='Enable debug output',
+                    action='store_true')
 
-parser.add_option("-t", "--task",
-        help = "find the signature data file for the specified task",
-        action="store", dest="taskargs", nargs=2, metavar='recipename taskname')
+parser.add_argument("-t", "--task",
+        help="find the signature data file for the last run of the specified task",
+        action="store", dest="taskargs", nargs=2, metavar=('recipename', 'taskname'))
 
-options, args = parser.parse_args(sys.argv)
+parser.add_argument("sigdatafile",
+        help="Signature file to dump. Not used when using -t/--task.",
+        action="store", nargs='?')
+
+options = parser.parse_args()
 
 if options.debug:
     logger.setLevel(logging.DEBUG)
@@ -97,11 +98,11 @@ if options.taskargs:
     tinfoil.prepare(config_only = True)
     file = find_siginfo_task(tinfoil, options.taskargs[0], options.taskargs[1])
     logger.debug("Signature file: %s" % file)
-elif len(args) == 1:
-    parser.print_help()
-    sys.exit(0)
+elif options.sigdatafile:
+    file = options.sigdatafile
 else:
-    file = args[1]
+    parser.print_help()
+    sys.exit(1)
 
 try:
     output = bb.siggen.dump_sigfile(file)
-- 
2.12.0



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

* ✗ patchtest: failure for "bitbake-dumpsig: Make --task w..." and 1 more
  2018-11-14  1:01 [PATCH 1/2] bitbake-dumpsig: Make --task work again Peter Kjellerstedt
  2018-11-14  1:01 ` [PATCH 2/2] bitbake-dumpsig: Change to use argparse Peter Kjellerstedt
@ 2018-11-14  1:33 ` Patchwork
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-11-14  1:33 UTC (permalink / raw)
  To: Peter Kjellerstedt; +Cc: openembedded-core

== Series Details ==

Series: "bitbake-dumpsig: Make --task w..." and 1 more
Revision: 1
URL   : https://patchwork.openembedded.org/series/14900/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists [test_target_mailing_list] 
  Suggested fix    Send the series again to the correct mailing list (ML)
  Suggested ML     bitbake-devel@lists.openembedded.org [http://git.openembedded.org/bitbake/]
  Patch's path:    bitbake/bin/bitbake-dumpsig

* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at f0394e80a3)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



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

* [PATCH 1/2] bitbake-dumpsig: Make --task work again
@ 2018-11-14  1:10 Peter Kjellerstedt
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Kjellerstedt @ 2018-11-14  1:10 UTC (permalink / raw)
  To: bitbake-devel

This corresponds to commit fdcea991 that fixed the --task option for
bitbake-diffsigs.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 bitbake/bin/bitbake-dumpsig | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)

diff --git a/bitbake/bin/bitbake-dumpsig b/bitbake/bin/bitbake-dumpsig
index 95ebd93546..40e08e0439 100755
--- a/bitbake/bin/bitbake-dumpsig
+++ b/bitbake/bin/bitbake-dumpsig
@@ -3,7 +3,8 @@
 # bitbake-dumpsig
 # BitBake task signature dump utility
 #
-# Copyright (C) 2013 Intel Corporation
+# Copyright (C) 2013, 2017 Intel Corporation
+# Copyright (C) 2017-2018 Axis Communications AB
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License version 2 as
@@ -33,17 +34,38 @@ import bb.msg
 
 logger = bb.msg.logger_create('bitbake-dumpsig')
 
+def find_siginfo(tinfoil, pn, taskname, sigs=None):
+    result = None
+    tinfoil.set_event_mask(['bb.event.FindSigInfoResult',
+                            'logging.LogRecord',
+                            'bb.command.CommandCompleted',
+                            'bb.command.CommandFailed'])
+    ret = tinfoil.run_command('findSigInfo', pn, taskname, sigs)
+    if ret:
+        while True:
+            event = tinfoil.wait_event(1)
+            if event:
+                if isinstance(event, bb.command.CommandCompleted):
+                    break
+                elif isinstance(event, bb.command.CommandFailed):
+                    logger.error(str(event))
+                    sys.exit(2)
+                elif isinstance(event, bb.event.FindSigInfoResult):
+                    result = event.result
+                elif isinstance(event, logging.LogRecord):
+                    logger.handle(event)
+    else:
+        logger.error('No result returned from findSigInfo command')
+        sys.exit(2)
+    return result
+
 def find_siginfo_task(bbhandler, pn, taskname):
     """ Find the most recent signature file for the specified PN/task """
 
-    if not hasattr(bb.siggen, 'find_siginfo'):
-        logger.error('Metadata does not support finding signature data files')
-        sys.exit(1)
-
     if not taskname.startswith('do_'):
         taskname = 'do_%s' % taskname
 
-    filedates = bb.siggen.find_siginfo(pn, taskname, None, bbhandler.config_data)
+    filedates = find_siginfo(bbhandler, pn, taskname)
     latestfiles = sorted(filedates.keys(), key=lambda f: filedates[f])[-1:]
     if not latestfiles:
         logger.error('No sigdata files found matching %s %s' % (pn, taskname))
-- 
2.12.0



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

end of thread, other threads:[~2018-11-14  1:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14  1:01 [PATCH 1/2] bitbake-dumpsig: Make --task work again Peter Kjellerstedt
2018-11-14  1:01 ` [PATCH 2/2] bitbake-dumpsig: Change to use argparse Peter Kjellerstedt
2018-11-14  1:33 ` ✗ patchtest: failure for "bitbake-dumpsig: Make --task w..." and 1 more Patchwork
2018-11-14  1:10 [PATCH 1/2] bitbake-dumpsig: Make --task work again Peter Kjellerstedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.