Revert "soong_zip: support globs in -f and -D arguments"

This reverts commit 08e28abc4e.

Reason for revert: inserts extra ../../ entries in the zip file.

Bug: 116737386
Change-Id: I048f94889a66fe618058e37a5827d0cf6b1a6b68
This commit is contained in:
Colin Cross
2018-09-26 21:36:22 +00:00
parent c7feeff1e9
commit 7f33b81ef6
5 changed files with 7 additions and 25 deletions

View File

@@ -199,11 +199,6 @@ func main() {
flags.Parse(expandedArgs[1:])
if flags.NArg() > 0 {
fmt.Fprintf(os.Stderr, "unexpected arguments %s\n", strings.Join(flags.Args(), " "))
usage()
}
err := zip.Run(zip.ZipArgs{
FileArgs: fArgs,
OutputFilePath: *out,

View File

@@ -224,20 +224,9 @@ func Run(args ZipArgs) (err error) {
noCompression := args.CompressionLevel == 0
for _, fa := range args.FileArgs {
var srcs []string
for _, s := range fa.SourceFiles {
globbed, _, err := pathtools.Glob(s, nil, pathtools.DontFollowSymlinks)
if err != nil {
return err
}
srcs = append(srcs, globbed...)
}
srcs := fa.SourceFiles
if fa.GlobDir != "" {
globbed, _, err := pathtools.Glob(filepath.Join(fa.GlobDir, "**/*"), nil, pathtools.DontFollowSymlinks)
if err != nil {
return err
}
srcs = append(srcs, globbed...)
srcs = append(srcs, recursiveGlobFiles(fa.GlobDir)...)
}
for _, src := range srcs {
err := fillPathPairs(fa, src, &pathMappings, args.NonDeflatedFiles, noCompression)