diff options
author | Colin Cross <ccross@android.com> | 2015-04-08 11:21:40 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2015-04-08 15:19:30 -0700 |
commit | fce532760f1d22c23df764aefbd3e08592c76105 (patch) | |
tree | f11f10e878c4634e489543625989187b750afb99 /glob | |
parent | 1332b0035caf416d4d9b275e6bfead48fe0b9cac (diff) | |
download | build_soong-fce532760f1d22c23df764aefbd3e08592c76105.tar.gz build_soong-fce532760f1d22c23df764aefbd3e08592c76105.tar.bz2 build_soong-fce532760f1d22c23df764aefbd3e08592c76105.zip |
Support subtracting sources from globs
Support -file or -path/glob in file lists that contain globs to
subtract files from the resulting glob. Also move source file
prefixing and handling into a common function.
Change-Id: Ib6d74ce22f53cae7348c4ba35b779976d90359a6
Diffstat (limited to 'glob')
-rw-r--r-- | glob/glob.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/glob/glob.go b/glob/glob.go index a8c348d9..a07501a0 100644 --- a/glob/glob.go +++ b/glob/glob.go @@ -65,7 +65,12 @@ func GlobWithDepFile(glob, fileListFile, depFile string, excludes []string) (fil } if match { for _, e := range excludes { - excludeMatch, err := filepath.Match(e, info.Name()) + var excludeMatch bool + if filepath.Base(e) == e { + excludeMatch, err = filepath.Match(e, info.Name()) + } else { + excludeMatch, err = filepath.Match(e, path) + } if err != nil { return err } |