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.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index ae64840062..d503111d85 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -77,6 +77,8 @@ def add(args, config, basepath, workspace):
77 with open(appendfile, 'w') as f: 77 with open(appendfile, 'w') as f:
78 f.write('inherit externalsrc\n') 78 f.write('inherit externalsrc\n')
79 f.write('EXTERNALSRC = "%s"\n' % srctree) 79 f.write('EXTERNALSRC = "%s"\n' % srctree)
80 if args.same_dir:
81 f.write('EXTERNALSRC_BUILD = "%s"\n' % srctree)
80 if initial_rev: 82 if initial_rev:
81 f.write('\n# initial_rev: %s\n' % initial_rev) 83 f.write('\n# initial_rev: %s\n' % initial_rev)
82 84
@@ -323,8 +325,11 @@ def modify(args, config, basepath, workspace):
323 f.write('inherit externalsrc\n') 325 f.write('inherit externalsrc\n')
324 f.write('# NOTE: We use pn- overrides here to avoid affecting multiple variants in the case where the recipe uses BBCLASSEXTEND\n') 326 f.write('# NOTE: We use pn- overrides here to avoid affecting multiple variants in the case where the recipe uses BBCLASSEXTEND\n')
325 f.write('EXTERNALSRC_pn-%s = "%s"\n' % (args.recipename, srctree)) 327 f.write('EXTERNALSRC_pn-%s = "%s"\n' % (args.recipename, srctree))
326 if bb.data.inherits_class('autotools-brokensep', rd): 328 if args.same_dir or bb.data.inherits_class('autotools-brokensep', rd):
327 logger.info('using source tree as build directory since original recipe inherits autotools-brokensep') 329 if args.same_dir:
330 logger.info('using source tree as build directory since --same-dir specified')
331 else:
332 logger.info('using source tree as build directory since original recipe inherits autotools-brokensep')
328 f.write('EXTERNALSRC_BUILD_pn-%s = "%s"\n' % (args.recipename, srctree)) 333 f.write('EXTERNALSRC_BUILD_pn-%s = "%s"\n' % (args.recipename, srctree))
329 if initial_rev: 334 if initial_rev:
330 f.write('\n# initial_rev: %s\n' % initial_rev) 335 f.write('\n# initial_rev: %s\n' % initial_rev)
@@ -503,6 +508,7 @@ def register_commands(subparsers, context):
503 formatter_class=argparse.ArgumentDefaultsHelpFormatter) 508 formatter_class=argparse.ArgumentDefaultsHelpFormatter)
504 parser_add.add_argument('recipename', help='Name for new recipe to add') 509 parser_add.add_argument('recipename', help='Name for new recipe to add')
505 parser_add.add_argument('srctree', help='Path to external source tree') 510 parser_add.add_argument('srctree', help='Path to external source tree')
511 parser_add.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true")
506 parser_add.add_argument('--version', '-V', help='Version to use within recipe (PV)') 512 parser_add.add_argument('--version', '-V', help='Version to use within recipe (PV)')
507 parser_add.set_defaults(func=add) 513 parser_add.set_defaults(func=add)
508 514
@@ -513,6 +519,7 @@ def register_commands(subparsers, context):
513 parser_add.add_argument('srctree', help='Path to external source tree') 519 parser_add.add_argument('srctree', help='Path to external source tree')
514 parser_add.add_argument('--wildcard', '-w', action="store_true", help='Use wildcard for unversioned bbappend') 520 parser_add.add_argument('--wildcard', '-w', action="store_true", help='Use wildcard for unversioned bbappend')
515 parser_add.add_argument('--extract', '-x', action="store_true", help='Extract source as well') 521 parser_add.add_argument('--extract', '-x', action="store_true", help='Extract source as well')
522 parser_add.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true")
516 parser_add.add_argument('--branch', '-b', default="devtool", help='Name for development branch to checkout (only when using -x)') 523 parser_add.add_argument('--branch', '-b', default="devtool", help='Name for development branch to checkout (only when using -x)')
517 parser_add.set_defaults(func=modify) 524 parser_add.set_defaults(func=modify)
518 525