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

Commit b002cc3f authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "releasetools: Fix an issue in common.GetSparseImage" am: 90c1763c

Original change: https://android-review.googlesource.com/c/platform/build/+/1602475

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I302dd296101733c794a8a11c6ce6713beb170678
parents 3cc2b4c4 90c1763c
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1939,12 +1939,13 @@ def GetSparseImage(which, tmpdir, input_zip, allow_shared_blocks,
    # filename listed in system.map may contain an additional leading slash
    # (i.e. "//system/framework/am.jar"). Using lstrip to get consistent
    # results.
    arcname = entry.replace(which, which.upper(), 1).lstrip('/')

    # Special handling another case, where files not under /system
    # And handle another special case, where files not under /system
    # (e.g. "/sbin/charger") are packed under ROOT/ in a target_files.zip.
    if which == 'system' and not arcname.startswith('SYSTEM'):
    arcname = entry.lstrip('/')
    if which == 'system' and not arcname.startswith('system'):
      arcname = 'ROOT/' + arcname
    else:
      arcname = arcname.replace(which, which.upper(), 1)

    assert arcname in input_zip.namelist(), \
        "Failed to find the ZIP entry for {}".format(entry)