]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
buildinfohelper: add method to set current build as CANCELLED
authorElliot Smith <elliot.smith@intel.com>
Thu, 12 May 2016 14:10:36 +0000 (15:10 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 17 May 2016 13:42:56 +0000 (14:42 +0100)
This will be used from toasterui to cancel the current command-line
build when a keyboard interrupt is captured.

[YOCTO #8515]

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>
lib/bb/ui/buildinfohelper.py

index ff4da78cdbcf751075c9cc6ebde09cdfe861b713..c5368f63be422a1d096b09835524dea1ea724230 100644 (file)
@@ -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)