diff --git a/android/makevars.go b/android/makevars.go index ece7091b6..a74185a5c 100644 --- a/android/makevars.go +++ b/android/makevars.go @@ -472,7 +472,8 @@ func (s *makeVarsSingleton) writeInstalls(installs, symlinks []katiInstall) []by fmt.Fprintf(buf, "\tchmod +x $@\n") } if extraFiles := install.extraFiles; extraFiles != nil { - fmt.Fprintf(buf, "\tunzip -qDD -d '%s' '%s'\n", extraFiles.dir.String(), extraFiles.zip.String()) + fmt.Fprintf(buf, "\t( unzip -qDD -d '%s' '%s' 2>&1 | grep -v \"zipfile is empty\"; exit $${PIPESTATUS[0]} ) || \\\n", extraFiles.dir.String(), extraFiles.zip.String()) + fmt.Fprintf(buf, "\t ( code=$$?; if [ $$code -ne 0 -a $$code -ne 1 ]; then exit $$code; fi )\n") } fmt.Fprintln(buf) } diff --git a/android/module.go b/android/module.go index 8bbfd8a7f..ad01e9ef7 100644 --- a/android/module.go +++ b/android/module.go @@ -3282,8 +3282,9 @@ func (m *moduleContext) installFile(installPath InstallPath, name string, srcPat extraCmds := "" if extraZip != nil { - extraCmds += fmt.Sprintf(" && unzip -qDD -d '%s' '%s'", + extraCmds += fmt.Sprintf(" && ( unzip -qDD -d '%s' '%s' 2>&1 | grep -v \"zipfile is empty\"; exit $${PIPESTATUS[0]} )", extraZip.dir.String(), extraZip.zip.String()) + extraCmds += " || ( code=$$?; if [ $$code -ne 0 -a $$code -ne 1 ]; then exit $$code; fi )" implicitDeps = append(implicitDeps, extraZip.zip) }