diff options
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/devtool/upgrade.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py index 297d646f55..41bd34e61a 100644 --- a/scripts/lib/devtool/upgrade.py +++ b/scripts/lib/devtool/upgrade.py | |||
@@ -1,6 +1,6 @@ | |||
1 | # Development tool - upgrade command plugin | 1 | # Development tool - upgrade command plugin |
2 | # | 2 | # |
3 | # Copyright (C) 2014-2015 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 |
@@ -355,6 +355,29 @@ def _create_new_recipe(newpv, md5, sha256, srcrev, srcbranch, workspace, tinfoil | |||
355 | 355 | ||
356 | return fullpath, copied | 356 | return fullpath, copied |
357 | 357 | ||
358 | |||
359 | def _check_git_config(): | ||
360 | def getconfig(name): | ||
361 | try: | ||
362 | value = bb.process.run('git config --global %s' % name)[0].strip() | ||
363 | except bb.process.ExecutionError as e: | ||
364 | if e.exitcode == 1: | ||
365 | value = None | ||
366 | else: | ||
367 | raise | ||
368 | return value | ||
369 | |||
370 | username = getconfig('user.name') | ||
371 | useremail = getconfig('user.email') | ||
372 | configerr = [] | ||
373 | if not username: | ||
374 | configerr.append('Please set your name using:\n git config --global user.name') | ||
375 | if not useremail: | ||
376 | configerr.append('Please set your email using:\n git config --global user.email') | ||
377 | if configerr: | ||
378 | raise DevtoolError('Your git configuration is incomplete which will prevent rebases from working:\n' + '\n'.join(configerr)) | ||
379 | |||
380 | |||
358 | def upgrade(args, config, basepath, workspace): | 381 | def upgrade(args, config, basepath, workspace): |
359 | """Entry point for the devtool 'upgrade' subcommand""" | 382 | """Entry point for the devtool 'upgrade' subcommand""" |
360 | 383 | ||
@@ -365,6 +388,8 @@ def upgrade(args, config, basepath, workspace): | |||
365 | if args.srcbranch and not args.srcrev: | 388 | if args.srcbranch and not args.srcrev: |
366 | raise DevtoolError("If you specify --srcbranch/-B then you must use --srcrev/-S to specify the revision" % args.recipename) | 389 | raise DevtoolError("If you specify --srcbranch/-B then you must use --srcrev/-S to specify the revision" % args.recipename) |
367 | 390 | ||
391 | _check_git_config() | ||
392 | |||
368 | tinfoil = setup_tinfoil(basepath=basepath, tracking=True) | 393 | tinfoil = setup_tinfoil(basepath=basepath, tracking=True) |
369 | try: | 394 | try: |
370 | rd = parse_recipe(config, tinfoil, args.recipename, True) | 395 | rd = parse_recipe(config, tinfoil, args.recipename, True) |