From c5b39fc554d31fd64b2fc5c83acc5018de224cf3 Mon Sep 17 00:00:00 2001 From: XiNGRZ Date: Mon, 29 Apr 2019 03:23:26 +0800 Subject: [PATCH] sm6150-common: releasetools: Add images to the output zip only if present Change-Id: Ic5d71c3e16c443a63814dd0f17398c2ae5c8469b --- releasetools.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/releasetools.py b/releasetools.py index 06f033e..cff8585 100644 --- a/releasetools.py +++ b/releasetools.py @@ -35,7 +35,11 @@ def IncrementalOTA_InstallEnd(info): def AddImage(info, basename, dest): 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) info.script.Print("Patching {} image unconditionally...".format(dest.split('/')[-1])) info.script.AppendExtra('package_extract_file("%s", "%s");' % (name, dest))