Allow '$' in some paths
The icu resource directories contain filenames that have '$' characters. Allow paths returned by the Glob functions to contain '$', on the assumption that real paths on disk are unlikely to contain strings that are valid ninja variables. Fix the Build rules to escape any paths that are passed as Path arguments. Fix the resource rules to manually escape the paths that are passed as strings. Test: m checkbuild Change-Id: Ie631bc6d96259e592adb280491a365c0df7ed0e2
This commit is contained in:
@@ -124,7 +124,11 @@ func (p PackageContext) RuleFunc(name string,
|
||||
// package-scoped variable's initialization.
|
||||
func (p PackageContext) SourcePathVariable(name, path string) blueprint.Variable {
|
||||
return p.VariableFunc(name, func(ctx PackageVarContext) string {
|
||||
return safePathForSource(ctx, path).String()
|
||||
p, err := safePathForSource(ctx, path)
|
||||
if err != nil {
|
||||
ctx.Errorf("%s", err.Error())
|
||||
}
|
||||
return p.String()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -136,7 +140,10 @@ func (p PackageContext) SourcePathsVariable(name, separator string, paths ...str
|
||||
return p.VariableFunc(name, func(ctx PackageVarContext) string {
|
||||
var ret []string
|
||||
for _, path := range paths {
|
||||
p := safePathForSource(ctx, path)
|
||||
p, err := safePathForSource(ctx, path)
|
||||
if err != nil {
|
||||
ctx.Errorf("%s", err.Error())
|
||||
}
|
||||
ret = append(ret, p.String())
|
||||
}
|
||||
return strings.Join(ret, separator)
|
||||
@@ -150,7 +157,10 @@ func (p PackageContext) SourcePathsVariable(name, separator string, paths ...str
|
||||
// as part of a package-scoped variable's initialization.
|
||||
func (p PackageContext) SourcePathVariableWithEnvOverride(name, path, env string) blueprint.Variable {
|
||||
return p.VariableFunc(name, func(ctx PackageVarContext) string {
|
||||
p := safePathForSource(ctx, path)
|
||||
p, err := safePathForSource(ctx, path)
|
||||
if err != nil {
|
||||
ctx.Errorf("%s", err.Error())
|
||||
}
|
||||
return ctx.Config().GetenvWithDefault(env, p.String())
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user