From: Matthew Dempsky Date: Fri, 3 Feb 2017 22:38:47 +0000 (-0800) Subject: cmd/dist: ignore .#foo.go files created by Emacs X-Git-Tag: go1.9beta1~1742 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=592c97fc8f55d65dc668b1acb3b5bdf46e851f9e;p=gostls13.git cmd/dist: ignore .#foo.go files created by Emacs go/build already ignores them, but they cause make.bash to fail. Fixes #18931. Change-Id: Idd5c8c2a6f2309ecd5f0d669660704d6f5612710 Reviewed-on: https://go-review.googlesource.com/36351 Run-TryBot: Matthew Dempsky Reviewed-by: Ian Lance Taylor TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/dist/buildtool.go b/src/cmd/dist/buildtool.go index 716f994243..2f8136600f 100644 --- a/src/cmd/dist/buildtool.go +++ b/src/cmd/dist/buildtool.go @@ -70,6 +70,13 @@ var bootstrapDirs = []string{ "math/big", } +// File prefixes that are ignored by go/build anyway, and cause +// problems with editor generated temporary files (#18931). +var ignorePrefixes = []string{ + ".", + "_", +} + // File suffixes that use build tags introduced since Go 1.4. // These must not be copied into the bootstrap build directory. var ignoreSuffixes = []string{ @@ -103,6 +110,11 @@ func bootstrapBuildTools() { xmkdirall(dst) Dir: for _, name := range xreaddirfiles(src) { + for _, pre := range ignorePrefixes { + if strings.HasPrefix(name, pre) { + continue Dir + } + } for _, suf := range ignoreSuffixes { if strings.HasSuffix(name, suf) { continue Dir