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

Commit cb9ace32 authored by Dan Albert's avatar Dan Albert Committed by Gerrit Code Review
Browse files

Merge "Do not use block_verify on target-files where feature is missing."

parents 105b94cc 910b005f
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -1030,14 +1030,14 @@ class BlockDifference:
    self.partition = partition
    self.check_first_block = check_first_block

    version = 1
    self.version = 1
    if OPTIONS.info_dict:
      version = max(
      self.version = max(
          int(i) for i in
          OPTIONS.info_dict.get("blockimgdiff_versions", "1").split(","))

    b = blockimgdiff.BlockImageDiff(tgt, src, threads=OPTIONS.worker_threads,
                                    version=version)
                                    version=self.version)
    tmpdir = tempfile.mkdtemp()
    OPTIONS.tempfiles.append(tmpdir)
    self.path = os.path.join(tmpdir, partition)
@@ -1060,10 +1060,15 @@ class BlockDifference:
    if not self.src:
      script.Print("Image %s will be patched unconditionally." % (partition,))
    else:
      if self.version >= 3:
        script.AppendExtra(('if block_image_verify("%s", '
                            'package_extract_file("%s.transfer.list"), '
                            '"%s.new.dat", "%s.patch.dat") then') %
                           (self.device, partition, partition, partition))
      else:
        script.AppendExtra('if range_sha1("%s", "%s") == "%s" then' %
                            (self.device, self.src.care_map.to_string_raw(),
                            self.src.TotalSha1()))
      script.Print("Verified %s image..." % (partition,))
      script.AppendExtra('else');