summaryrefslogtreecommitdiffstats
path: root/tools/releasetools/ota_from_target_files
diff options
context:
space:
mode:
authordhacker29 <dhackerdvm@gmail.com>2014-12-02 02:01:56 -0500
committerAdnan Begovic <adnan@cyngn.com>2015-10-06 17:52:09 -0700
commit905c5eb43f0783780d89afac70064bca25fd2468 (patch)
tree9cc13a0637e7013744e6a80e748188f9fdd8a881 /tools/releasetools/ota_from_target_files
parent019509a576a131fb97327c1c815be87773dfdf8e (diff)
downloadbuild-905c5eb43f0783780d89afac70064bca25fd2468.zip
build-905c5eb43f0783780d89afac70064bca25fd2468.tar.gz
build-905c5eb43f0783780d89afac70064bca25fd2468.tar.bz2
Fix ro.build.product not found by ota_from_target_files in some cases
After I5dccba2172dade3dacc55d832a2042fce306b5f5 it was possible that if override_prop was set and override_device was not set the script was looking for a prop that did not exist. Change-Id: I444a33de5bcb59f129bdcf631c2a6540c5926545
Diffstat (limited to 'tools/releasetools/ota_from_target_files')
-rwxr-xr-xtools/releasetools/ota_from_target_files21
1 files changed, 11 insertions, 10 deletions
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files
index e6b5fcc..a8274ca 100755
--- a/tools/releasetools/ota_from_target_files
+++ b/tools/releasetools/ota_from_target_files
@@ -416,10 +416,7 @@ def AppendAssertions(script, info_dict, oem_dict=None):
oem_props = info_dict.get("oem_fingerprint_properties")
if oem_props is None or len(oem_props) == 0:
if OPTIONS.override_device == "auto":
- if OPTIONS.override_prop:
- device = GetBuildProp("ro.build.product", info_dict)
- else:
- device = GetBuildProp("ro.product.device", info_dict)
+ device = GetBuildProp("ro.product.device", info_dict)
else:
device = OPTIONS.override_device
script.AssertDevice(device)
@@ -1200,12 +1197,16 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
oem_dict = common.LoadDictionaryFromLines(
open(OPTIONS.oem_source).readlines())
- metadata = {
- "pre-device": GetOemProperty("ro.product.device", oem_props, oem_dict,
- OPTIONS.source_info_dict),
- "post-timestamp": GetBuildProp("ro.build.date.utc",
- OPTIONS.target_info_dict),
- }
+ if OPTIONS.override_prop:
+ metadata = {"post-timestamp": GetBuildProp("ro.build.date.utc",
+ OPTIONS.target_info_dict),
+ }
+ else:
+ metadata = {"pre-device": GetOemProperty("ro.product.device", oem_props, oem_dict,
+ OPTIONS.source_info_dict),
+ "post-timestamp": GetBuildProp("ro.build.date.utc",
+ OPTIONS.target_info_dict),
+ }
device_specific = common.DeviceSpecificParams(
source_zip=source_zip,