Edify: Add abort message for bootloader asserts
* If a bootloader assert is not satisfied, print the versions that are supported by the package as well as the version on the device. Change-Id: I958d49281c51bd4e60d596a727bb94cfc4a21909
This commit is contained in:
@@ -146,10 +146,13 @@ class EdifyGenerator(object):
|
|||||||
self.script.append(self.WordWrap(cmd))
|
self.script.append(self.WordWrap(cmd))
|
||||||
|
|
||||||
def AssertSomeBootloader(self, *bootloaders):
|
def AssertSomeBootloader(self, *bootloaders):
|
||||||
"""Asert that the bootloader version is one of *bootloaders."""
|
"""Assert that the bootloader version is one of *bootloaders."""
|
||||||
cmd = ("assert(" +
|
cmd = ("assert(" +
|
||||||
" ||\0".join(['getprop("ro.bootloader") == "%s"' % (b,)
|
" ||\0".join(['getprop("ro.bootloader") == "%s"' % (b,)
|
||||||
for b in bootloaders]) +
|
for b in bootloaders]) +
|
||||||
|
' || abort("This package supports bootloader(s): ' +
|
||||||
|
", ".join(["%s" % (b,) for b in bootloaders]) +
|
||||||
|
'; this device has bootloader " + getprop("ro.bootloader") + ".");' +
|
||||||
");")
|
");")
|
||||||
self.script.append(self.WordWrap(cmd))
|
self.script.append(self.WordWrap(cmd))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user