[yocto] [PATCH 7/8] yocto-bsp: new script

Darren Hart dvhart at linux.intel.com
Fri Mar 2 09:20:39 PST 2012



On 03/01/2012 11:01 PM, tom.zanussi at intel.com wrote:
> From: Tom Zanussi <tom.zanussi at intel.com>
> 
> Implementation of the 'yocto-bsp' command-line tool, for creating BSPs
> and listing BSP properties.
> 
> Signed-off-by: Tom Zanussi <tom.zanussi at intel.com>
> ---
>  scripts/yocto-bsp |  131 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 131 insertions(+), 0 deletions(-)
>  create mode 100755 scripts/yocto-bsp
> 
> diff --git a/scripts/yocto-bsp b/scripts/yocto-bsp
> new file mode 100755
> index 0000000..20fa89d
> --- /dev/null
> +++ b/scripts/yocto-bsp
> @@ -0,0 +1,131 @@
> +#!/usr/bin/env python
> +# ex:ts=4:sw=4:sts=4:et
> +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
> +#
> +# Copyright 2012 Intel Corporation
> +# Authored-by:  Tom Zanussi <tom.zanussi at intel.com>
> +#

same comment...

...

> +def yocto_bsp_list_subcommand(args, usage_str):
> +    """
> +    Command-line handling for listing available BSP properties and
> +    values.  The real work is done by bsp.engine.yocto_bsp_list()
> +    """
> +    parser = optparse.OptionParser(usage = usage_str)
> +
> +    parser.add_option("-o", "--outfile", action = "store", dest = "properties_file",
> +                      help = "dump the possible values for BSP properties to a JSON file")
> +
> +    (options, args) = parser.parse_args(args)
> +
> +    if not yocto_bsp_list(args, scripts_path, options.properties_file):
> +        logging.error("Bad list arguments, exiting\n")
> +        parser.print_help()
> +        exit(1)


I see sys.exit() below and just exit() here, and above you "import sys",
so I believe this should also be sys.exit()

...

> +if __name__ == "__main__":
> +    try:
> +        ret = main()
> +    except Exception:
> +        ret = 1
> +        import traceback
> +        traceback.print_exc(5)
> +    sys.exit(ret)
> +

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel



More information about the yocto mailing list