diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-09-22 17:21:24 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-23 09:53:14 +0100 |
commit | ae788fbd46f8a83d4c1776eeb4457ed5bb61915f (patch) | |
tree | 409a44ee48ca6b70d7bc26ea9ae3354063f82899 /scripts/lib/devtool/standard.py | |
parent | 99cd79d8be25c9dca232c3c197b09ea3961ad729 (diff) | |
download | poky-ae788fbd46f8a83d4c1776eeb4457ed5bb61915f.tar.gz |
devtool: check that source tree still exists
Sometimes, particularly if you extracted the source to /tmp which is on
tmpfs, the external source tree that is being pointed to may no longer
exist when you come to run "devtool build" or "devtool update-recipe"
etc. Make all of the commands that need to check for a recipe being in
the workspace call a single function and have that function additionally
check the source tree still exists where appropriate.
(From OE-Core rev: 0c3f289576a2ab35b1d1d8854d6763553cc3bf09)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/standard.py')
-rw-r--r-- | scripts/lib/devtool/standard.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index d5900b4f82..018ef2a987 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -25,7 +25,7 @@ import logging | |||
25 | import argparse | 25 | import argparse |
26 | import scriptutils | 26 | import scriptutils |
27 | import errno | 27 | import errno |
28 | from devtool import exec_build_env_command, setup_tinfoil, DevtoolError | 28 | from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, DevtoolError |
29 | from devtool import parse_recipe | 29 | from devtool import parse_recipe |
30 | 30 | ||
31 | logger = logging.getLogger('devtool') | 31 | logger = logging.getLogger('devtool') |
@@ -776,9 +776,7 @@ def _guess_recipe_update_mode(srctree, rdata): | |||
776 | 776 | ||
777 | def update_recipe(args, config, basepath, workspace): | 777 | def update_recipe(args, config, basepath, workspace): |
778 | """Entry point for the devtool 'update-recipe' subcommand""" | 778 | """Entry point for the devtool 'update-recipe' subcommand""" |
779 | if not args.recipename in workspace: | 779 | check_workspace_recipe(workspace, args.recipename) |
780 | raise DevtoolError("no recipe named %s in your workspace" % | ||
781 | args.recipename) | ||
782 | 780 | ||
783 | if args.append: | 781 | if args.append: |
784 | if not os.path.exists(args.append): | 782 | if not os.path.exists(args.append): |
@@ -830,9 +828,8 @@ def reset(args, config, basepath, workspace): | |||
830 | if args.recipename: | 828 | if args.recipename: |
831 | if args.all: | 829 | if args.all: |
832 | raise DevtoolError("Recipe cannot be specified if -a/--all is used") | 830 | raise DevtoolError("Recipe cannot be specified if -a/--all is used") |
833 | elif not args.recipename in workspace: | 831 | else: |
834 | raise DevtoolError("no recipe named %s in your workspace" % | 832 | check_workspace_recipe(workspace, args.recipename, checksrc=False) |
835 | args.recipename) | ||
836 | elif not args.all: | 833 | elif not args.all: |
837 | raise DevtoolError("Recipe must be specified, or specify -a/--all to " | 834 | raise DevtoolError("Recipe must be specified, or specify -a/--all to " |
838 | "reset all recipes") | 835 | "reset all recipes") |