[OE-core] [PATCH v3] devtool: add package plugin that lets you create package via devtool

Paul Eggleton paul.eggleton at linux.intel.com
Fri Sep 4 14:35:52 UTC 2015


On Thursday 03 September 2015 23:09:30 brendan.le.foll at intel.com wrote:
> From: Brendan Le Foll <brendan.le.foll at intel.com>
> 
> Signed-off-by: Brendan Le Foll <brendan.le.foll at intel.com>
> ---
>  scripts/lib/devtool/package.py | 61
> ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+)
>  create mode 100644 scripts/lib/devtool/package.py
> 
> diff --git a/scripts/lib/devtool/package.py b/scripts/lib/devtool/package.py
> new file mode 100644
> index 0000000..e9d4240
> --- /dev/null
> +++ b/scripts/lib/devtool/package.py
> @@ -0,0 +1,61 @@
> +# Development tool - package command plugin
> +#
> +# Copyright (C) 2014-2015 Intel Corporation
> +#
> +# 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
> +# published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License along
> +# with this program; if not, write to the Free Software Foundation, Inc.,
> +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> +"""Devtool plugin containing the package subcommands"""
> +
> +import os
> +import subprocess
> +import logging
> +from bb.process import ExecutionError
> +from devtool import exec_build_env_command, setup_tinfoil, DevtoolError
> +
> +logger = logging.getLogger('devtool')
> +
> +def plugin_init(pluginlist):
> +    """Plugin initialization"""
> +    pass
> +
> +def package(args, config, basepath, workspace):
> +    """Entry point for the devtool 'package' subcommand"""
> +    if not args.recipename in workspace:
> +        raise DevtoolError("no recipe named %s in your workspace" %
> +                           args.recipename)
> +
> +    try:
> +        image_pkgtype = config.get('image_pkgtype', None)

This isn't quite right - to be fair though I think you may have copy-pasted 
something I sent you privately which wasn't correct. The first parameter is the 
section, second the value name, third the default. If you specify a default 
you won't need to put it in try/except, just "if not image_pkgtype:'.

Don't worry about fixing this though, I'm currently rolling up devtool patches 
into a series and I will fix it as part of that.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the Openembedded-core mailing list