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

Commit 83ea7831 authored by Kelvin Zhang's avatar Kelvin Zhang
Browse files

Filter out ab_partitions in source_info as well

When generating a incremental partial OTA, we need to filter out
partitions in ab_partitions which are not in partial list

Test: Generate a partial incremental OTA
Change-Id: Iff7748ce6181a9a231557de0539004211587232c
parent 6f83343e
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -1254,11 +1254,6 @@ def main(argv):
    OPTIONS.info_dict = common.LoadInfoDict(OPTIONS.extracted_input)
  else:
    OPTIONS.info_dict = ParseInfoDict(args[0])
  if OPTIONS.partial:
    OPTIONS.info_dict['ab_partitions'] = \
      list(
        set(OPTIONS.info_dict['ab_partitions']) & set(OPTIONS.partial)
        )

  if OPTIONS.downgrade:
    # We should only allow downgrading incrementals (as opposed to full).
@@ -1284,6 +1279,17 @@ def main(argv):
    logger.info("--- source info ---")
    common.DumpInfoDict(OPTIONS.source_info_dict)

  if OPTIONS.partial:
    OPTIONS.info_dict['ab_partitions'] = \
      list(
        set(OPTIONS.info_dict['ab_partitions']) & set(OPTIONS.partial)
        )
    if OPTIONS.source_info_dict:
      OPTIONS.source_info_dict['ab_partitions'] = \
        list(
          set(OPTIONS.source_info_dict['ab_partitions']) & set(OPTIONS.partial)
          )

  # Load OEM dicts if provided.
  OPTIONS.oem_dicts = _LoadOemDicts(OPTIONS.oem_source)