Escape Host*Variable contents am: 1c35f243c5

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1915494

Change-Id: I78a98453a932c7cace65bfaf0c2d39a2469342e6
This commit is contained in:
Colin Cross 2021-12-10 22:04:40 +00:00 committed by Automerger Merge Worker
commit 72d35eb0a5

View file

@ -19,6 +19,7 @@ import (
"strings"
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
"android/soong/remoteexec"
)
@ -173,7 +174,7 @@ func (p PackageContext) SourcePathVariableWithEnvOverride(name, path, env string
// package-scoped variable's initialization.
func (p PackageContext) HostBinToolVariable(name, path string) blueprint.Variable {
return p.VariableFunc(name, func(ctx PackageVarContext) string {
return ctx.Config().HostToolPath(ctx, path).String()
return proptools.NinjaAndShellEscape(ctx.Config().HostToolPath(ctx, path).String())
})
}
@ -183,7 +184,7 @@ func (p PackageContext) HostBinToolVariable(name, path string) blueprint.Variabl
// package-scoped variable's initialization.
func (p PackageContext) HostJNIToolVariable(name, path string) blueprint.Variable {
return p.VariableFunc(name, func(ctx PackageVarContext) string {
return ctx.Config().HostJNIToolPath(ctx, path).String()
return proptools.NinjaAndShellEscape(ctx.Config().HostJNIToolPath(ctx, path).String())
})
}
@ -193,7 +194,7 @@ func (p PackageContext) HostJNIToolVariable(name, path string) blueprint.Variabl
// part of a package-scoped variable's initialization.
func (p PackageContext) HostJavaToolVariable(name, path string) blueprint.Variable {
return p.VariableFunc(name, func(ctx PackageVarContext) string {
return ctx.Config().HostJavaToolPath(ctx, path).String()
return proptools.NinjaAndShellEscape(ctx.Config().HostJavaToolPath(ctx, path).String())
})
}