diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2018-05-14 16:35:22 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-05-14 14:08:56 +0100 |
commit | 449564783dfb162536a2f772b3a8704973221e0f (patch) | |
tree | a131482c358b42c64e7b7b559f977d6c1f6bae45 | |
parent | 5f64946b8740a5d944f48ec430470265703bfe5e (diff) | |
download | openembedded-core-449564783dfb162536a2f772b3a8704973221e0f.tar.gz openembedded-core-449564783dfb162536a2f772b3a8704973221e0f.tar.bz2 openembedded-core-449564783dfb162536a2f772b3a8704973221e0f.zip |
devtool/sdk.py: error out in case of downloading file failure
It's possible that downloading file from updateserver fails. In
this case, we should error out instead of continue.
We have users reporting unexpected behavior of 'devtool sdk-update'.
When an invalid url is supplied, e.g., `devtool sdk-update http://invalid',
the program reports 'Note: Already up-to-date'.
This is obviously not expected. We should error out in such case.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | scripts/lib/devtool/sdk.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/lib/devtool/sdk.py b/scripts/lib/devtool/sdk.py index f46577c2ab..4616753797 100644 --- a/scripts/lib/devtool/sdk.py +++ b/scripts/lib/devtool/sdk.py @@ -145,6 +145,9 @@ def sdk_update(args, config, basepath, workspace): # Fetch manifest from server tmpmanifest = os.path.join(tmpsdk_dir, 'conf', 'sdk-conf-manifest') ret = subprocess.call("wget -q -O %s %s/conf/sdk-conf-manifest" % (tmpmanifest, updateserver), shell=True) + if ret != 0: + logger.error("Cannot dowload files from %s" % updateserver) + return ret changedfiles = check_manifest(tmpmanifest, basepath) if not changedfiles: logger.info("Already up-to-date") |