Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 953c6b79 authored by Matt Mower's avatar Matt Mower Committed by Michael Bestas
Browse files

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
parent 8182bc29
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -141,10 +141,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))

@@ -153,6 +156,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))