]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: ignore .#foo.go files created by Emacs
authorMatthew Dempsky <mdempsky@google.com>
Fri, 3 Feb 2017 22:38:47 +0000 (14:38 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Sat, 4 Feb 2017 00:15:59 +0000 (00:15 +0000)
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 <mdempsky@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/dist/buildtool.go

index 716f99424341d051740e64f0f168da64301fde7c..2f8136600f44c2c3c0aa530deb0fe4075f6c8e0e 100644 (file)
@@ -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