[Toaster] [PATCH] toasterui: set Build outcome to CANCELLED on cli interrupt

Smith, Elliot elliot.smith at intel.com
Thu Apr 28 03:03:02 PDT 2016


Please ignore, I have to rework this.

Elliot

On 27 April 2016 at 15:46, Elliot Smith <elliot.smith at intel.com> wrote:

> If a command-line build is interrupted with Ctrl-C or similar,
> set the outcome of the Build to CANCELLED. This ensures that
> interrupted builds don't "hang" in the Toaster UI and
> are displayed as required by the design.
>
> [YOCTO #8515]
>
> Signed-off-by: Elliot Smith <elliot.smith at intel.com>
> ---
>  bitbake/lib/bb/ui/buildinfohelper.py | 10 ++++++++++
>  bitbake/lib/bb/ui/toasterui.py       |  1 +
>  2 files changed, 11 insertions(+)
>
> diff --git a/bitbake/lib/bb/ui/buildinfohelper.py
> b/bitbake/lib/bb/ui/buildinfohelper.py
> index 9397905..83dc098 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)
> diff --git a/bitbake/lib/bb/ui/toasterui.py
> b/bitbake/lib/bb/ui/toasterui.py
> index 6bf4c1f..fb476a3 100644
> --- a/bitbake/lib/bb/ui/toasterui.py
> +++ b/bitbake/lib/bb/ui/toasterui.py
> @@ -442,6 +442,7 @@ def main(server, eventHandler, params):
>                  pass
>          except KeyboardInterrupt:
>              main.shutdown = 1
> +            buildinfohelper.cancel_cli_build()
>          except Exception as e:
>              # print errors to log
>              import traceback
> --
> 1.9.3
>
> ---------------------------------------------------------------------
> Intel Corporation (UK) Limited
> Registered No. 1134945 (England)
> Registered Office: Pipers Way, Swindon SN3 1RJ
> VAT No: 860 2173 47
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
>


-- 
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/toaster/attachments/20160428/a40ececd/attachment-0001.html>


More information about the toaster mailing list