diff options
author | Zhao Wei Liew <zhaoweiliew@gmail.com> | 2017-01-25 22:39:55 +0800 |
---|---|---|
committer | Zhao Wei Liew <zhaoweiliew@gmail.com> | 2017-01-25 22:41:19 +0800 |
commit | 3cfeedb4ae21399128cbc6f96ce3162611fafe1f (patch) | |
tree | 588b5295586e549439296225aac916d1e00e9693 | |
parent | 9347d9680eca73a55d83fea3c9320e91aa92605a (diff) | |
download | build-3cfeedb4ae21399128cbc6f96ce3162611fafe1f.zip build-3cfeedb4ae21399128cbc6f96ce3162611fafe1f.tar.gz build-3cfeedb4ae21399128cbc6f96ce3162611fafe1f.tar.bz2 |
ota_from_target_files: Fix cherry-pick error
In commit 24d91d8dd36b1b2a681461bea56a44605521861e,
info_dict is yet to be initialized when it is checked for
"ota_override_device" and "ota_override_prop".
Move the checks down to after info_dict is initialized.
Change-Id: Ibcbc4f993dcd2dd281ec19624107dddd994fd497
-rwxr-xr-x | tools/releasetools/ota_from_target_files.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index c2fbb1d..66db227 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -1653,11 +1653,6 @@ def main(argv): common.Usage(__doc__) sys.exit(1) - if "ota_override_device" in OPTIONS.info_dict: - OPTIONS.override_device = OPTIONS.info_dict.get("ota_override_device") - if "ota_override_prop" in OPTIONS.info_dict: - OPTIONS.override_prop = OPTIONS.info_dict.get("ota_override_prop") == "true" - if OPTIONS.extra_script is not None: OPTIONS.extra_script = open(OPTIONS.extra_script).read() @@ -1667,6 +1662,11 @@ def main(argv): OPTIONS.target_tmp = OPTIONS.input_tmp OPTIONS.info_dict = common.LoadInfoDict(input_zip) + if "ota_override_device" in OPTIONS.info_dict: + OPTIONS.override_device = OPTIONS.info_dict.get("ota_override_device") + if "ota_override_prop" in OPTIONS.info_dict: + OPTIONS.override_prop = OPTIONS.info_dict.get("ota_override_prop") == "true" + # If this image was originally labelled with SELinux contexts, make sure we # also apply the labels in our new image. During building, the "file_contexts" # is in the out/ directory tree, but for repacking from target-files.zip it's |