]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.cc] cmd/dist: build new5a etc during bootstrap
authorRuss Cox <rsc@golang.org>
Wed, 21 Jan 2015 17:10:35 +0000 (12:10 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 21 Jan 2015 19:43:09 +0000 (19:43 +0000)
The change to the bootstrap import conversion is
for the a.y files, which use import dot.

While we're editing the tool list, add "cmd/dist".
Right now 'go install cmd/dist' installs to $GOROOT/bin/dist.
(A new bug since cmd/dist has been rewritten in Go.
When cmd/dist was a C program, go install cmd/dist just didn't work.)

Change-Id: I362208dcfb4ae64c987f60b95dc946829fa506d8
Reviewed-on: https://go-review.googlesource.com/3144
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/cmd/dist/buildtool.go
src/cmd/go/pkg.go

index 10371526d33d1ff71a64c424b33e842ac3029368..6cfe4c78b5be616c12df110c7cc9f436fff69bec 100644 (file)
@@ -23,11 +23,16 @@ import (
 // which are commands, and entries beginning with internal/, which are
 // packages supporting the commands.
 var bootstrapDirs = []string{
+       "internal/asm",
        "internal/obj",
        "internal/obj/arm",
        "internal/obj/i386",
        "internal/obj/ppc64",
        "internal/obj/x86",
+       "new5a",
+       "new6a",
+       "new8a",
+       "new9a",
        "objwriter",
 }
 
@@ -112,7 +117,8 @@ func bootstrapFixImports(text, srcFile string) string {
                        inBlock = false
                        continue
                }
-               if strings.HasPrefix(line, "import \"") || inBlock && strings.HasPrefix(line, "\t\"") {
+               if strings.HasPrefix(line, `import "`) || strings.HasPrefix(line, `import . "`) ||
+                       inBlock && (strings.HasPrefix(line, "\t\"") || strings.HasPrefix(line, "\t. \"")) {
                        lines[i] = strings.Replace(line, `"cmd/internal/`, `"bootstrap/internal/`, -1)
                }
        }
index e224eef0911db7461e4ea9f4aaf383df8b715b5d..9e0f1f6c6c09ec11153277a9678d0d4939e8a335 100644 (file)
@@ -394,6 +394,7 @@ var goTools = map[string]targetDir{
        "cmd/addr2line":                        toTool,
        "cmd/api":                              toTool,
        "cmd/cgo":                              toTool,
+       "cmd/dist":                             toTool,
        "cmd/fix":                              toTool,
        "cmd/link":                             toTool,
        "cmd/new5a":                            toTool,