summaryrefslogtreecommitdiffstats
path: root/tools/releasetools/edify_generator.py
diff options
context:
space:
mode:
authorMatt Mower <mowerm@gmail.com>2014-08-28 18:29:14 -0500
committerAdnan Begovic <adnan@cyngn.com>2015-10-06 17:45:35 -0700
commitc709d336c21cc840bb13168aa9c4125666c4c5c7 (patch)
tree290b8f0eac86c0405eb16cab79a92415b520c99e /tools/releasetools/edify_generator.py
parent2be98b8f472f3f4b85aafbbf96ff868e47c9d3be (diff)
downloadbuild-c709d336c21cc840bb13168aa9c4125666c4c5c7.zip
build-c709d336c21cc840bb13168aa9c4125666c4c5c7.tar.gz
build-c709d336c21cc840bb13168aa9c4125666c4c5c7.tar.bz2
Edify: Add/Update abort messages for some asserts
* If a bootloader or baseband assert is not satisfied, print the versions that are supported by the package as well as the version on the device. Change-Id: I958d49281c51bd4e60d596a727bb94cfc4a21909
Diffstat (limited to 'tools/releasetools/edify_generator.py')
-rw-r--r--tools/releasetools/edify_generator.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py
index d754aca..f17d7ed 100644
--- a/tools/releasetools/edify_generator.py
+++ b/tools/releasetools/edify_generator.py
@@ -126,10 +126,13 @@ class EdifyGenerator(object):
self.script.append(cmd)
def AssertSomeBootloader(self, *bootloaders):
- """Asert that the bootloader version is one of *bootloaders."""
+ """Assert that the bootloader version is one of *bootloaders."""
cmd = ("assert(" +
" || ".join(['getprop("ro.bootloader") == "%s"' % (b,)
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))
@@ -138,6 +141,9 @@ class EdifyGenerator(object):
cmd = ("assert(" +
" || ".join(['getprop("ro.baseband") == "%s"' % (b,)
for b in basebands]) +
+ ' || abort("This package supports baseband(s): ' +
+ ", ".join(["%s" % (b,) for b in basebands]) +
+ '; this device has baseband " + getprop("ro.baseband") + ".");' +
");")
self.script.append(self._WordWrap(cmd))