forked from openkylin/platform_build
c6bd70a5e6
The image building functions in build_image.py have been returning (success, result) or special values to indicate the validity of the result. The same logic can be better expressed by raising exceptions instead, because a) using a special value relies on caller to check for that magic value; b) exceptions can carry additional messages other than a boolean does, e.g. the output from the failing command; c) caller can have cleaner code flow without explicitly checking for the validity of the result. This CL changes such functions to raise on errors. The majority of these functions are internal to build_image.py only, except for BuildImage() that has a few callers in add_img_to_target_files.py (which all die upon error anyway). Test: `m dist` Test: python -m unittest test_build_image Test: python -m unittest test_add_img_to_target_files Test: python -m unittest test_validate_target_files Test: Inject an error to the depended binaries (e.g. avbtool), and check that build_image.py exits with error messages. Change-Id: Ibe4d51e267756bb1a00fa9238a213f9d55fd9b58 |
||
---|---|---|
.. | ||
acp | ||
apicheck | ||
atree | ||
docker | ||
droiddoc | ||
fs_config | ||
fs_get_stats | ||
libhost | ||
makeparallel | ||
releasetools | ||
signapk | ||
signtos | ||
zipalign | ||
ziptime | ||
Android.mk | ||
OWNERS | ||
auto_gen_test_config.py | ||
auto_gen_test_config_test.py | ||
brillo-clang-format | ||
buildinfo.sh | ||
buildinfo_common.sh | ||
check_builds.sh | ||
check_link_type.py | ||
check_radio_versions.py | ||
checkowners.py | ||
compare_fileslist.py | ||
dump-package-stats | ||
event_log_tags.py | ||
fat16copy.py | ||
fileslist_util.py | ||
filter-product-graph.py | ||
findleaves.py | ||
fixlinebreaks.sh | ||
generate-enforce-rro-android-manifest.py | ||
generate-notice-files.py | ||
java-event-log-tags.py | ||
java-layers.py | ||
merge-event-log-tags.py | ||
mktarball.sh | ||
normalize_path.py | ||
parsedeps.py | ||
post_process_props.py | ||
print_module_licenses.sh | ||
product_debug.py | ||
soong_to_convert.py | ||
uuidgen.py | ||
warn.py |