sm6150-common: releaseteools: Rename timestamp to modem_version

Change-Id: Ieb258d37fccd1a4371183ca73d5c836d9d8d4941
This commit is contained in:
Arian 2021-07-15 10:31:59 +02:00
parent 514f6bb6b0
commit 2c30dfedda
No known key found for this signature in database
GPG Key ID: 48029380598CE3B9

View File

@ -1,6 +1,7 @@
#
# Copyright (C) 2009 The Android Open Source Project
# Copyright (C) 2019 The Mokee Open Source Project
# Copyright (C) 2020 The LineageOS Open Source Project
# Copyright (C) 2020-2021 The LineageOS Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -13,6 +14,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import common
import re
@ -54,10 +56,10 @@ 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:
timestamp, firmware_version = m.group(1).rstrip().split(',')
timestamps = timestamp.split('|')
if ((len(timestamps) and '*' not in timestamps) and \
modem_version, firmware_version = m.group(1).rstrip().split(',')
modem_versions = modem_version.split('|')
if ((len(modem_versions) and '*' not in modem_versions) and \
(len(firmware_version) and '*' not in firmware_version)):
cmd = 'assert(xiaomi.verify_baseband(' + ','.join(['"%s"' % baseband for baseband in timestamps]) + ') == "1" || abort("ERROR: This package requires firmware from MIUI {1} or newer. Please upgrade firmware and retry!"););'
info.script.AppendExtra(cmd.format(timestamps, firmware_version))
cmd = 'assert(xiaomi.verify_baseband(' + ','.join(['"%s"' % baseband for baseband in modem_versions]) + ') == "1" || abort("ERROR: This package requires firmware from MIUI {1} or newer. Please upgrade firmware and retry!"););'
info.script.AppendExtra(cmd.format(modem_versions, firmware_version))
return