aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-01-07 00:15:47 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-15 15:41:32 +0000
commitd9c5653f994e0f366c9154a2a988175a9f8e3130 (patch)
tree9dc8fee3bceab907515edf840e570c53d34d48b2 /scripts
parenta0e1ff92b189681df5cf106dc924e76bb05caf31 (diff)
downloadopenembedded-core-contrib-d9c5653f994e0f366c9154a2a988175a9f8e3130.tar.gz
devtool: sdk-update: fix error checking
Running "raise" with no arguments here is invalid, we're not in exception handling context. Rather than also adding code to catch the exception I just moved the check out to the parent function from which we can just exit. (From OE-Core master rev: 0164dc66467739b357ab22bf9b8c0845f3eff4a4) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/devtool/sdk.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/scripts/lib/devtool/sdk.py b/scripts/lib/devtool/sdk.py
index 331c236bd1..f15a6a9ed7 100644
--- a/scripts/lib/devtool/sdk.py
+++ b/scripts/lib/devtool/sdk.py
@@ -40,14 +40,9 @@ def generate_update_dict(sigfile_new, sigfile_old):
continue
return update_dict
-def get_sstate_objects(update_dict, newsdk_path):
+def get_sstate_objects(update_dict, sstate_dir):
"""Return a list containing sstate objects which are to be installed"""
sstate_objects = []
- # Ensure newsdk_path points to an extensible SDK
- sstate_dir = os.path.join(newsdk_path, 'sstate-cache')
- if not os.path.exists(sstate_dir):
- logger.error("sstate-cache directory not found under %s" % newsdk_path)
- raise
for k in update_dict:
files = set()
hashval = update_dict[k]
@@ -116,7 +111,11 @@ def sdk_update(args, config, basepath, workspace):
logger.debug("Found conf/locked-sigs.inc in %s" % updateserver)
update_dict = generate_update_dict(new_locked_sig_file_path, old_locked_sig_file_path)
logger.debug("update_dict = %s" % update_dict)
- sstate_objects = get_sstate_objects(update_dict, updateserver)
+ sstate_dir = os.path.join(newsdk_path, 'sstate-cache')
+ if not os.path.exists(sstate_dir):
+ logger.error("sstate-cache directory not found under %s" % newsdk_path)
+ return 1
+ sstate_objects = get_sstate_objects(update_dict, sstate_dir)
logger.debug("sstate_objects = %s" % sstate_objects)
if len(sstate_objects) == 0:
logger.info("No need to update.")