diff options
| author | codeworkx <daniel.hillenbrand@codeworkx.de> | 2018-05-28 20:56:14 +0200 |
|---|---|---|
| committer | Han Wang <416810799@qq.com> | 2019-01-24 15:22:41 +0100 |
| commit | cd3937a65f7724f9b5c3220467d4fbea39f6d308 (patch) | |
| tree | 3a5bb7b5edd2217148ada76968ce3d09a223ce7f | |
| parent | 520b522a3d462ea7023071ba278e5dcb9eae13c5 (diff) | |
oneplus2: releasetools: Make modem check more user friendly
Change-Id: Ib334abf1d53ba889d1b4f746657336fae2d47db2
| -rwxr-xr-x | releasetools.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/releasetools.py b/releasetools.py index 1ba5336..3d9dca0 100755 --- a/releasetools.py +++ b/releasetools.py @@ -30,8 +30,9 @@ def AddBasebandAssertion(info, input_zip): android_info = input_zip.read("OTA/android-info.txt") m = re.search(r'require\s+version-baseband\s*=\s*(.+)', android_info) if m: - version = m.group(1).rstrip() - if len(version) and '*' not in version: - cmd = 'assert(oneplus2.verify_baseband("' + version + '") == "1");' - info.script.AppendExtra(cmd) + timestamp, firmware_version = m.group(1).rstrip().split(',') + if ((len(timestamp) and '*' not in timestamp) and \ + (len(firmware_version) and '*' not in firmware_version)): + cmd = 'assert(oneplus2.verify_baseband("{}") == "1" || abort("ERROR: This package requires firmware from OOS {} or newer. Please upgrade firmware and retry!"););' + info.script.AppendExtra(cmd.format(timestamp, firmware_version)) return |
