summaryrefslogtreecommitdiffstats
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-11 15:41:46 +0000
commitd586a11ef7e701b414ff7222f43fe9a4f76669cf (patch)
tree1e2e2c1483f31b4b1a8287983b4fdc7212d5e8c1 /scripts
parentc1b7d83d7758d6eaf2814b9629b78661505fec6e (diff)
downloadpoky-d586a11ef7e701b414ff7222f43fe9a4f76669cf.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 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 daa3e4ecae..2d9d911e4c 100644
--- a/scripts/lib/devtool/sdk.py
+++ b/scripts/lib/devtool/sdk.py
@@ -36,14 +36,9 @@ def generate_update_dict(sigfile_new, sigfile_old):
36 continue 36 continue
37 return update_dict 37 return update_dict
38 38
39def get_sstate_objects(update_dict, newsdk_path): 39def get_sstate_objects(update_dict, sstate_dir):
40 """Return a list containing sstate objects which are to be installed""" 40 """Return a list containing sstate objects which are to be installed"""
41 sstate_objects = [] 41 sstate_objects = []
42 # Ensure newsdk_path points to an extensible SDK
43 sstate_dir = os.path.join(newsdk_path, 'sstate-cache')
44 if not os.path.exists(sstate_dir):
45 logger.error("sstate-cache directory not found under %s" % newsdk_path)
46 raise
47 for k in update_dict: 42 for k in update_dict:
48 files = set() 43 files = set()
49 hashval = update_dict[k] 44 hashval = update_dict[k]
@@ -112,7 +107,11 @@ def sdk_update(args, config, basepath, workspace):
112 logger.debug("Found conf/locked-sigs.inc in %s" % updateserver) 107 logger.debug("Found conf/locked-sigs.inc in %s" % updateserver)
113 update_dict = generate_update_dict(new_locked_sig_file_path, old_locked_sig_file_path) 108 update_dict = generate_update_dict(new_locked_sig_file_path, old_locked_sig_file_path)
114 logger.debug("update_dict = %s" % update_dict) 109 logger.debug("update_dict = %s" % update_dict)
115 sstate_objects = get_sstate_objects(update_dict, updateserver) 110 sstate_dir = os.path.join(newsdk_path, 'sstate-cache')
111 if not os.path.exists(sstate_dir):
112 logger.error("sstate-cache directory not found under %s" % newsdk_path)
113 return 1
114 sstate_objects = get_sstate_objects(update_dict, sstate_dir)
116 logger.debug("sstate_objects = %s" % sstate_objects) 115 logger.debug("sstate_objects = %s" % sstate_objects)
117 if len(sstate_objects) == 0: 116 if len(sstate_objects) == 0:
118 logger.info("No need to update.") 117 logger.info("No need to update.")