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

Commit 9e8e7d7b authored by Romain Jobredeaux's avatar Romain Jobredeaux Committed by Android (Google) Code Review
Browse files

Merge "Allow empty zip file in extra files in install command." into tm-dev

parents 60c0b9ec 84efaf45
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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)
	}
+2 −1
Original line number Diff line number Diff line
@@ -3208,8 +3208,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)
			}