summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/sdk.py
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:51:41 +0000
commit255115f6e4b820ef5fe1c7092366e4c68dbfb0b6 (patch)
treebf789f1801e93202500b60777087e77df8d13b1a /scripts/lib/devtool/sdk.py
parent3f691055c5ae74f7a690401d737167cb94af5532 (diff)
downloadpoky-255115f6e4b820ef5fe1c7092366e4c68dbfb0b6.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) (From OE-Core rev: d9c5653f994e0f366c9154a2a988175a9f8e3130) 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/sdk.py')
-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):
40 continue 40 continue
41 return update_dict 41 return update_dict
42 42
43def get_sstate_objects(update_dict, newsdk_path): 43def get_sstate_objects(update_dict, sstate_dir):
44 """Return a list containing sstate objects which are to be installed""" 44 """Return a list containing sstate objects which are to be installed"""
45 sstate_objects = [] 45 sstate_objects = []
46 # Ensure newsdk_path points to an extensible SDK
47 sstate_dir = os.path.join(newsdk_path, 'sstate-cache')
48 if not os.path.exists(sstate_dir):
49 logger.error("sstate-cache directory not found under %s" % newsdk_path)
50 raise
51 for k in update_dict: 46 for k in update_dict:
52 files = set() 47 files = set()
53 hashval = update_dict[k] 48 hashval = update_dict[k]
@@ -116,7 +111,11 @@ def sdk_update(args, config, basepath, workspace):
116 logger.debug("Found conf/locked-sigs.inc in %s" % updateserver) 111 logger.debug("Found conf/locked-sigs.inc in %s" % updateserver)
117 update_dict = generate_update_dict(new_locked_sig_file_path, old_locked_sig_file_path) 112 update_dict = generate_update_dict(new_locked_sig_file_path, old_locked_sig_file_path)
118 logger.debug("update_dict = %s" % update_dict) 113 logger.debug("update_dict = %s" % update_dict)
119 sstate_objects = get_sstate_objects(update_dict, updateserver) 114 sstate_dir = os.path.join(newsdk_path, 'sstate-cache')
115 if not os.path.exists(sstate_dir):
116 logger.error("sstate-cache directory not found under %s" % newsdk_path)
117 return 1
118 sstate_objects = get_sstate_objects(update_dict, sstate_dir)
120 logger.debug("sstate_objects = %s" % sstate_objects) 119 logger.debug("sstate_objects = %s" % sstate_objects)
121 if len(sstate_objects) == 0: 120 if len(sstate_objects) == 0:
122 logger.info("No need to update.") 121 logger.info("No need to update.")