diff options
author | 2018-09-28 15:16:48 -0700 | |
---|---|---|
committer | 2018-09-28 16:14:52 -0700 | |
commit | 4be8f9e2a3e857050f4d6d9b3d728492828445bf (patch) | |
tree | 02d5d87c95a304bfeb58f4f436d7fa4043f06763 /zip/cmd/main.go | |
parent | 09f11056f876a9f705a53fd6f122aa7575e0b51b (diff) |
soong_zip: add --ignore_missing_files flag
soong_zip builds a list of files to zip early and then starts
zipping them all. If a directory being zipped is concurrently
modified, a file that existed when soong_zip started may not
still exist. Add a flag that continues when an expected file
does not exist. Print a warning, since this should be rare
in normal usages but is a sign of a problem if it happens
regularly.
Test: zip_test.go
Test: m checkbuild
Test: m platform
Change-Id: I78426fe66fded8528ddd436c0f71a7442183cfeb
Diffstat (limited to 'zip/cmd/main.go')
-rw-r--r-- | zip/cmd/main.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/zip/cmd/main.go b/zip/cmd/main.go index 4a0849128..b4f75f7af 100644 --- a/zip/cmd/main.go +++ b/zip/cmd/main.go @@ -136,7 +136,7 @@ func main() { compLevel := flags.Int("L", 5, "deflate compression level (0-9)") emulateJar := flags.Bool("jar", false, "modify the resultant .zip to emulate the output of 'jar'") writeIfChanged := flags.Bool("write_if_changed", false, "only update resultant .zip if it has changed") - + ignoreMissingFiles := flags.Bool("ignore_missing_files", false, "continue if a requested file does not exist") symlinks := flags.Bool("symlinks", true, "store symbolic links in zip instead of following them") parallelJobs := flags.Int("parallel", runtime.NumCPU(), "number of parallel threads to use") @@ -200,6 +200,7 @@ func main() { NonDeflatedFiles: nonDeflatedFiles, WriteIfChanged: *writeIfChanged, StoreSymlinks: *symlinks, + IgnoreMissingFiles: *ignoreMissingFiles, }) if err != nil { fmt.Fprintln(os.Stderr, "error:", err.Error()) |