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

Commit 481bab8d authored by Tao Bao's avatar Tao Bao
Browse files

releasetools: Add a BuildInfo class.

Prior to this CL, we have similar codes in different paths
(WriteFullOTAPackage / WriteBlockIncrementalOTAPackage /
WriteABOTAPackageWithBrilloScript). This CL factors out the common codes
that deal with OEM-specific properties into BuildInfo class, and adds
tests for the new class.

Test: python -m unittest test_ota_from_target_files
Test: Create an incremental package that uses and doesn't use OEM
      properties respectively.
Test: Create a full package that uses and doesn't use OEM properties
      respectively.
Change-Id: Ida914cace12803d55396fa503bafcac2db2a520e
parent e3692095
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -77,14 +77,14 @@ class EdifyGenerator(object):
    with temporary=True) to this one."""
    self.script.extend(other.script)

  def AssertOemProperty(self, name, values):
  def AssertOemProperty(self, name, values, oem_no_mount):
    """Assert that a property on the OEM paritition matches allowed values."""
    if not name:
      raise ValueError("must specify an OEM property")
    if not values:
      raise ValueError("must specify the OEM value")
    get_prop_command = None
    if common.OPTIONS.oem_no_mount:

    if oem_no_mount:
      get_prop_command = 'getprop("%s")' % name
    else:
      get_prop_command = 'file_getprop("/oem/oem.prop", "%s")' % name