# Development tool - standard commands 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 standard plugins"""
import os
import sys
import re
import shutil
import tempfile
import logging
import argparse
import argparse_oe
import scriptutils
import errno
import glob
from collections import OrderedDict
from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, use_external_build, setup_git_repo, recipe_to_append, DevtoolError
from devtool import parse_recipe
logger = logging.getLogger('devtool')
def add(args, config, basepath, workspace):
"""Entry point for the devtool 'add' subcommand"""
import bb
import oe.recipeutils
if not args.recipename and not args.srctree and not args.fetch and not args.fetchuri:
raise argparse_oe.ArgumentUsageError('At least one of recipename, srctree, fetchuri or -f/--fetch must be specified', 'add')
# These are positional arguments, but because we're nice, allow
# specifying e.g. source tree without name, or fetch URI without name or
# source tree (if we can detect that that is what the user meant)
if '://' in args.recipename:
if not args.fetchuri:
if args.fetch:
raise DevtoolError('URI specified as positional argument as well as -f/--fetch')
args.fetchuri = args.recipename
args.recipename = ''
elif '://' in args.srctree:
if not args.fetchuri:
if args.fetch:
raise DevtoolError('URI specified as positional argument as well as -f/--fetch')
args.fetchuri = args.srctree
args.srctree = ''
elif args.recipename and not args.srctree:
if os.sep in args.recipename:
args.srctree = args.recipename
args.recipename = None
elif os.path.isdir(args.recipename):
logger.warn('Ambiguous argument %s - assuming you mean it to be the recipe name')
if args.fetch:
if args.fetchuri:
raise DevtoolError('URI specified as positional argument as well as -f/--fetch')
else:
# FIXME should show a warning that -f/--fetch is deprecated here
args.fetchuri = args.fetch
if args.recipename:
if args.recipename in workspace:
raise DevtoolError("recipe %s is already in your workspace" %
args.recipename)
reason = oe.recipeutils.validate_pn(args.recipename)
if reason:
raise DevtoolError(reason)
# FIXME this ought to be in validate_pn but we're using that in other contexts
if '/' in args.recipename:
raise DevtoolError('"/" is not a valid character in recipe names')
if args.srctree:
srctree = os.path.abspath(args.srctree)
srctreeparent = None
tmpsrcdir = Non2012-06-08 | rpcbind: add and use startup script, move binaries | Christopher Larson |
2012-02-21 | rpcbind: add DEPENDS on quota for rpcsvc/rquota.h | Saul Wold |
2011-07-01 | Drop PRIORITY variable | Richard Purdie |
2011-05-12 | recipes: add Upstream-Status for multiple recipes | Dongxiao Xu |
2010-12-16 | recipes-extended: Add Summary information | Mark Hatle |
2010-12-09 | SRC_URI Checksums Additionals | Saul Wold |
2010-09-02 | rpcbind: move patch to correct location | Saul Wold |
2010-09-02 | rpcbind: add patch to fix host include path | Saul Wold |
2010-09-02 | rpcbind: add new recipe version 0.2.0 | Dongxiao Xu |