コード例 #1
0
def edit(args):
    import oe.recipeutils

    recipe_path = tinfoil.get_recipe_file(args.target)
    appends = tinfoil.get_file_appends(recipe_path)

    return scriptutils.run_editor([recipe_path] + appends, logger)
コード例 #2
0
ファイル: newappend.py プロジェクト: agangidi53/openbmc
def newappend(args):
    import oe.recipeutils

    recipe_path = _get_recipe_file(tinfoil.cooker, args.target)

    rd = tinfoil.config_data.createCopy()
    rd.setVar('FILE', recipe_path)
    append_path, path_ok = oe.recipeutils.get_bbappend_path(rd, args.destlayer, args.wildcard_version)
    if not append_path:
        logger.error('Unable to determine layer directory containing %s', recipe_path)
        return 1

    if not path_ok:
        logger.warn('Unable to determine correct subdirectory path for bbappend file - check that what %s adds to BBFILES also matches .bbappend files. Using %s for now, but until you fix this the bbappend will not be applied.', os.path.join(args.destlayer, 'conf', 'layer.conf'), os.path.dirname(append_path))

    layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS', True).split()]
    if not os.path.abspath(args.destlayer) in layerdirs:
        logger.warn('Specified layer is not currently enabled in bblayers.conf, you will need to add it before this bbappend will be active')

    if not os.path.exists(append_path):
        bb.utils.mkdirhier(os.path.dirname(append_path))

        try:
            open(append_path, 'a').close()
        except (OSError, IOError) as exc:
            logger.critical(str(exc))
            return 1

    if args.edit:
        return scriptutils.run_editor([append_path, recipe_path])
    else:
        print(append_path)
コード例 #3
0
def edit(args):
    import oe.recipeutils

    recipe_path = tinfoil.get_recipe_file(args.target)
    appends = tinfoil.get_file_appends(recipe_path)

    return scriptutils.run_editor([recipe_path] + appends, logger)
def newappend(args):
    import oe.recipeutils

    recipe_path = tinfoil.get_recipe_file(args.target)

    rd = tinfoil.config_data.createCopy()
    rd.setVar('FILE', recipe_path)
    append_path, path_ok = oe.recipeutils.get_bbappend_path(rd, args.destlayer, args.wildcard_version)
    if not append_path:
        logger.error('Unable to determine layer directory containing %s', recipe_path)
        return 1

    if not path_ok:
        logger.warning('Unable to determine correct subdirectory path for bbappend file - check that what %s adds to BBFILES also matches .bbappend files. Using %s for now, but until you fix this the bbappend will not be applied.', os.path.join(args.destlayer, 'conf', 'layer.conf'), os.path.dirname(append_path))

    layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS').split()]
    if not os.path.abspath(args.destlayer) in layerdirs:
        logger.warning('Specified layer is not currently enabled in bblayers.conf, you will need to add it before this bbappend will be active')

    if not os.path.exists(append_path):
        bb.utils.mkdirhier(os.path.dirname(append_path))

        try:
            open(append_path, 'a').close()
        except (OSError, IOError) as exc:
            logger.critical(str(exc))
            return 1

    if args.edit:
        return scriptutils.run_editor([append_path, recipe_path], logger)
    else:
        print(append_path)
コード例 #5
0
def edit_recipe(args, config, basepath, workspace):
    """Entry point for the devtool 'edit-recipe' subcommand"""
    if args.any_recipe:
        tinfoil = setup_tinfoil(config_only=False, basepath=basepath)
        try:
            rd = parse_recipe(config, tinfoil, args.recipename, True)
            if not rd:
                return 1
            recipefile = rd.getVar('FILE')
        finally:
            tinfoil.shutdown()
    else:
        check_workspace_recipe(workspace, args.recipename)
        recipefile = workspace[args.recipename]['recipefile']
        if not recipefile:
            raise DevtoolError("Recipe file for %s is not under the workspace" %
                               args.recipename)

    return scriptutils.run_editor(recipefile)
コード例 #6
0
def edit_recipe(args, config, basepath, workspace):
    """Entry point for the devtool 'edit-recipe' subcommand"""
    if args.any_recipe:
        tinfoil = setup_tinfoil(config_only=False, basepath=basepath)
        try:
            rd = parse_recipe(config, tinfoil, args.recipename, True)
            if not rd:
                return 1
            recipefile = rd.getVar('FILE', True)
        finally:
            tinfoil.shutdown()
    else:
        check_workspace_recipe(workspace, args.recipename)
        recipefile = workspace[args.recipename]['recipefile']
        if not recipefile:
            raise DevtoolError("Recipe file for %s is not under the workspace" %
                               args.recipename)

    return scriptutils.run_editor(recipefile)
コード例 #7
0
ファイル: utilcmds.py プロジェクト: 01org/luv-yocto
def edit_recipe(args, config, basepath, workspace):
    """Entry point for the devtool 'edit-recipe' subcommand"""
    return scriptutils.run_editor(_find_recipe_path(args, config, basepath, workspace), logger)
コード例 #8
0
ファイル: utilcmds.py プロジェクト: arolgroup/exor-workspace
def edit_recipe(args, config, basepath, workspace):
    """Entry point for the devtool 'edit-recipe' subcommand"""
    return scriptutils.run_editor(
        _find_recipe_path(args, config, basepath, workspace), logger)