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

Commit 8e9155f2 authored by Tao Bao's avatar Tao Bao Committed by android-build-merger
Browse files

Merge "releasetools: Fix a mismatching close." am: 395bf274 am: 06bc45b0

am: 6b93ed0c

Change-Id: I74f9e797510bcecdb1f93824ce5881f92ff3b152
parents 921c81f7 6b93ed0c
Loading
Loading
Loading
Loading
+3 −8
Original line number Original line Diff line number Diff line
@@ -1354,8 +1354,8 @@ def WriteABOTAPackageWithBrilloScript(target_file, output_file,
    return value
    return value


  # Stage the output zip package for package signing.
  # Stage the output zip package for package signing.
  temp_zip_file = tempfile.NamedTemporaryFile()
  staging_file = common.MakeTempFile(suffix='.zip')
  output_zip = zipfile.ZipFile(temp_zip_file, "w",
  output_zip = zipfile.ZipFile(staging_file, "w",
                               compression=zipfile.ZIP_DEFLATED)
                               compression=zipfile.ZIP_DEFLATED)


  if source_file is not None:
  if source_file is not None:
@@ -1419,10 +1419,6 @@ def WriteABOTAPackageWithBrilloScript(target_file, output_file,
    else:
    else:
      print("Warning: cannot find care map file in target_file package")
      print("Warning: cannot find care map file in target_file package")


  # source_info must be None for full OTAs.
  if source_file is None:
    assert source_info is None

  AddCompatibilityArchiveIfTrebleEnabled(
  AddCompatibilityArchiveIfTrebleEnabled(
      target_zip, output_zip, target_info, source_info)
      target_zip, output_zip, target_info, source_info)


@@ -1440,8 +1436,7 @@ def WriteABOTAPackageWithBrilloScript(target_file, output_file,
  # compute the ZIP entry offsets, write back the final metadata and do the
  # compute the ZIP entry offsets, write back the final metadata and do the
  # final signing.
  # final signing.
  prelim_signing = common.MakeTempFile(suffix='.zip')
  prelim_signing = common.MakeTempFile(suffix='.zip')
  SignOutput(temp_zip_file.name, prelim_signing)
  SignOutput(staging_file, prelim_signing)
  common.ZipClose(temp_zip_file)


  # Open the signed zip. Compute the final metadata that's needed for streaming.
  # Open the signed zip. Compute the final metadata that's needed for streaming.
  prelim_signing_zip = zipfile.ZipFile(prelim_signing, 'r')
  prelim_signing_zip = zipfile.ZipFile(prelim_signing, 'r')