From: Alexander Kanavin Date: Mon, 1 Aug 2022 15:44:34 +0000 (+0200) Subject: devtool/upgrade: catch bb.fetch2.decodeurl errors X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~3449 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74774f9b67580a8c56f605dfd4cc7b856bbeeae8;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git devtool/upgrade: catch bb.fetch2.decodeurl errors Otherwise, workspace cleanup (removing bogus recipe and source tree) will not happen, leaving breakage behind. Signed-off-by: Alexander Kanavin Signed-off-by: Luca Ceresoli --- diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py index c57015eb40c..39a1910a494 100644 --- a/scripts/lib/devtool/upgrade.py +++ b/scripts/lib/devtool/upgrade.py @@ -336,7 +336,10 @@ def _create_new_recipe(newpv, md5, sha256, srcrev, srcbranch, srcsubdir_old, src replacing = True new_src_uri = [] for entry in src_uri: - scheme, network, path, user, passwd, params = bb.fetch2.decodeurl(entry) + try: + scheme, network, path, user, passwd, params = bb.fetch2.decodeurl(entry) + except bb.fetch2.MalformedUrl as e: + raise DevtoolError("Could not decode SRC_URI: {}".format(e)) if replacing and scheme in ['git', 'gitsm']: branch = params.get('branch', 'master') if rd.expand(branch) != srcbranch: