summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/standard.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/devtool/standard.py')
-rw-r--r--scripts/lib/devtool/standard.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index d79ebf1a4e..174cc861e1 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -1,6 +1,6 @@
1# Development tool - standard commands plugin 1# Development tool - standard commands plugin
2# 2#
3# Copyright (C) 2014-2016 Intel Corporation 3# Copyright (C) 2014-2017 Intel Corporation
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License version 2 as 6# it under the terms of the GNU General Public License version 2 as
@@ -66,6 +66,12 @@ def add(args, config, basepath, workspace):
66 elif os.path.isdir(args.recipename): 66 elif os.path.isdir(args.recipename):
67 logger.warn('Ambiguous argument "%s" - assuming you mean it to be the recipe name' % args.recipename) 67 logger.warn('Ambiguous argument "%s" - assuming you mean it to be the recipe name' % args.recipename)
68 68
69 if not args.fetchuri:
70 if args.srcrev:
71 raise DevtoolError('The -S/--srcrev option is only valid when fetching from an SCM repository')
72 if args.srcbranch:
73 raise DevtoolError('The -B/--srcbranch option is only valid when fetching from an SCM repository')
74
69 if args.srctree and os.path.isfile(args.srctree): 75 if args.srctree and os.path.isfile(args.srctree):
70 args.fetchuri = 'file://' + os.path.abspath(args.srctree) 76 args.fetchuri = 'file://' + os.path.abspath(args.srctree)
71 args.srctree = '' 77 args.srctree = ''
@@ -151,6 +157,10 @@ def add(args, config, basepath, workspace):
151 extracmdopts += ' --fetch-dev' 157 extracmdopts += ' --fetch-dev'
152 if args.mirrors: 158 if args.mirrors:
153 extracmdopts += ' --mirrors' 159 extracmdopts += ' --mirrors'
160 if args.srcrev:
161 extracmdopts += ' --srcrev %s' % args.srcrev
162 if args.srcbranch:
163 extracmdopts += ' --srcbranch %s' % args.srcbranch
154 164
155 tempdir = tempfile.mkdtemp(prefix='devtool') 165 tempdir = tempfile.mkdtemp(prefix='devtool')
156 try: 166 try:
@@ -1809,7 +1819,10 @@ def register_commands(subparsers, context):
1809 parser_add.add_argument('--fetch-dev', help='For npm, also fetch devDependencies', action="store_true") 1819 parser_add.add_argument('--fetch-dev', help='For npm, also fetch devDependencies', action="store_true")
1810 parser_add.add_argument('--version', '-V', help='Version to use within recipe (PV)') 1820 parser_add.add_argument('--version', '-V', help='Version to use within recipe (PV)')
1811 parser_add.add_argument('--no-git', '-g', help='If fetching source, do not set up source tree as a git repository', action="store_true") 1821 parser_add.add_argument('--no-git', '-g', help='If fetching source, do not set up source tree as a git repository', action="store_true")
1812 parser_add.add_argument('--autorev', '-a', help='When fetching from a git repository, set SRCREV in the recipe to a floating revision instead of fixed', action="store_true") 1822 group = parser_add.add_mutually_exclusive_group()
1823 group.add_argument('--srcrev', '-S', help='Source revision to fetch if fetching from an SCM such as git (default latest)')
1824 group.add_argument('--autorev', '-a', help='When fetching from a git repository, set SRCREV in the recipe to a floating revision instead of fixed', action="store_true")
1825 parser_add.add_argument('--srcbranch', '-B', help='Branch in source repository if fetching from an SCM such as git (default master)')
1813 parser_add.add_argument('--binary', '-b', help='Treat the source tree as something that should be installed verbatim (no compilation, same directory structure). Useful with binary packages e.g. RPMs.', action='store_true') 1826 parser_add.add_argument('--binary', '-b', help='Treat the source tree as something that should be installed verbatim (no compilation, same directory structure). Useful with binary packages e.g. RPMs.', action='store_true')
1814 parser_add.add_argument('--also-native', help='Also add native variant (i.e. support building recipe for the build host as well as the target machine)', action='store_true') 1827 parser_add.add_argument('--also-native', help='Also add native variant (i.e. support building recipe for the build host as well as the target machine)', action='store_true')
1815 parser_add.add_argument('--src-subdir', help='Specify subdirectory within source tree to use', metavar='SUBDIR') 1828 parser_add.add_argument('--src-subdir', help='Specify subdirectory within source tree to use', metavar='SUBDIR')