diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2018-04-18 13:38:28 +1200 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2018-05-04 23:57:53 +1200 |
commit | 369b03c6dbd5d45b25075010e809b92207b08d54 (patch) | |
tree | e368071613bbe0d6d5dae05eaa3eabc7656b81ef /rrs/tools/rrs_upstream_history.py | |
parent | 7ea14221b84f71f04292734c11c9f23ef636bf71 (diff) | |
download | openembedded-core-contrib-369b03c6dbd5d45b25075010e809b92207b08d54.tar.gz |
rrs_upstream_history: make more robust
Avoid exceptions / blank versions during recipe upstream crashing the
entire script.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'rrs/tools/rrs_upstream_history.py')
-rwxr-xr-x | rrs/tools/rrs_upstream_history.py | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/rrs/tools/rrs_upstream_history.py b/rrs/tools/rrs_upstream_history.py index ee13c3a831..ce60d8f5a4 100755 --- a/rrs/tools/rrs_upstream_history.py +++ b/rrs/tools/rrs_upstream_history.py @@ -114,13 +114,17 @@ def get_upstream_info(layerbranch, recipe_data, result): upv, _, _ = get_recipe_pv_without_srcpv(ru_info['version'], get_pv_type(ru_info['version'])) - cmp_ver = vercmp_string(pv, upv) - if cmp_ver == -1: - ru.status = 'N' # Not update - elif cmp_ver == 0: - ru.status = 'Y' # Up-to-date - elif cmp_ver == 1: - ru.status = 'D' # Downgrade, need to review why + if pv and upv: + cmp_ver = vercmp_string(pv, upv) + if cmp_ver == -1: + ru.status = 'N' # Not update + elif cmp_ver == 0: + ru.status = 'Y' # Up-to-date + elif cmp_ver == 1: + ru.status = 'D' # Downgrade, need to review why + else: + logger.debug('Unable to determine upgrade status for %s: %s -> %s' % (recipe.pn, pv, upv)) + ru.status = 'U' # Unknown else: ru.version = '' ru.type = 'M' @@ -203,7 +207,11 @@ if __name__=="__main__": result = [] for recipe_data in recipes: - get_upstream_info(layerbranch, recipe_data, result) + try: + get_upstream_info(layerbranch, recipe_data, result) + except: + import traceback + traceback.print_exc() history.end_date = datetime.now() history.save() |