summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/__init__.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-09-22 17:21:24 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-23 09:53:14 +0100
commitae788fbd46f8a83d4c1776eeb4457ed5bb61915f (patch)
tree409a44ee48ca6b70d7bc26ea9ae3354063f82899 /scripts/lib/devtool/__init__.py
parent99cd79d8be25c9dca232c3c197b09ea3961ad729 (diff)
downloadpoky-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/__init__.py')
-rw-r--r--scripts/lib/devtool/__init__.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index 404d3e6645..fb699b5c61 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -136,3 +136,17 @@ def parse_recipe(config, tinfoil, pn, appends):
136 not path.startswith(config.workspace_path)] 136 not path.startswith(config.workspace_path)]
137 return oe.recipeutils.parse_recipe(recipefile, append_files, 137 return oe.recipeutils.parse_recipe(recipefile, append_files,
138 tinfoil.config_data) 138 tinfoil.config_data)
139
140def check_workspace_recipe(workspace, pn, checksrc=True):
141 """
142 Check that a recipe is in the workspace and (optionally) that source
143 is present.
144 """
145 if not pn in workspace:
146 raise DevtoolError("No recipe named '%s' in your workspace" % pn)
147 if checksrc:
148 srctree = workspace[pn]['srctree']
149 if not os.path.exists(srctree):
150 raise DevtoolError("Source tree %s for recipe %s does not exist" % (srctree, pn))
151 if not os.listdir(srctree):
152 raise DevtoolError("Source tree %s for recipe %s is empty" % (srctree, pn))