[gnome-continuous-yocto/gnomeostree-3.28-rocko: 346/8267] bitbake: buildinfohelper: add method to set current build as CANCELLED



commit df0fc2d90884150f896ac87e401c10ce3bb95850
Author: Elliot Smith <elliot smith intel com>
Date:   Thu May 12 15:10:36 2016 +0100

    bitbake: buildinfohelper: add method to set current build as CANCELLED
    
    This will be used from toasterui to cancel the current command-line
    build when a keyboard interrupt is captured.
    
    [YOCTO #8515]
    
    (Bitbake rev: 1486c770327b53bb5e04baa5f3ea26d8154aed63)
    
    Signed-off-by: Elliot Smith <elliot smith intel com>
    Signed-off-by: Michael Wood <michael g wood intel com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 bitbake/lib/bb/ui/buildinfohelper.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index ff4da78..c5368f6 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -1251,6 +1251,16 @@ class BuildInfoHelper(object):
 
 
 
+    def cancel_cli_build(self):
+        """
+        If a build is currently underway, set its state to CANCELLED;
+        note that this only gets called for command line builds which are
+        interrupted, so it doesn't touch any BuildRequest objects
+        """
+        build = self.internal_state['build']
+        if build:
+            build.outcome = Build.CANCELLED
+            build.save()
 
     def store_dependency_information(self, event):
         assert '_depgraph' in vars(event)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]