sm6150-common: releasetools: Add images to the output zip only if present

Change-Id: Ic5d71c3e16c443a63814dd0f17398c2ae5c8469b
This commit is contained in:
XiNGRZ 2019-04-29 03:23:26 +08:00 committed by Arian
parent 2f6d32221d
commit c5b39fc554
No known key found for this signature in database
GPG Key ID: 48029380598CE3B9

View File

@ -35,7 +35,11 @@ def IncrementalOTA_InstallEnd(info):
def AddImage(info, basename, dest): def AddImage(info, basename, dest):
name = basename name = basename
data = info.input_zip.read("IMAGES/" + basename) path = "IMAGES/" + name
if path not in info.input_zip.namelist():
return
data = info.input_zip.read(path)
common.ZipWriteStr(info.output_zip, name, data) common.ZipWriteStr(info.output_zip, name, data)
info.script.Print("Patching {} image unconditionally...".format(dest.split('/')[-1])) info.script.Print("Patching {} image unconditionally...".format(dest.split('/')[-1]))
info.script.AppendExtra('package_extract_file("%s", "%s");' % (name, dest)) info.script.AppendExtra('package_extract_file("%s", "%s");' % (name, dest))