go/go-build-dont-reinstall-stdlibs.patch

37 lines
1.1 KiB
Diff
Raw Normal View History

diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go
index cf249cd..56c540f 100644
--- a/src/cmd/go/build.go
+++ b/src/cmd/go/build.go
@@ -85,6 +85,7 @@ func init() {
}
// Flags set by multiple commands.
+var buildS bool // OPENSUSE -s (for packaging only)
var buildA bool // -a flag
var buildN bool // -n flag
var buildP = runtime.NumCPU() // -p flag
@@ -101,6 +102,10 @@ var buildContext = build.Default
// addBuildFlags adds the flags common to the build and install commands.
func addBuildFlags(cmd *Command) {
// NOTE: If you add flags here, also add them to testflag.go.
+
+ // OPENSUSE
+ cmd.Flag.BoolVar(&buildS, "s", false, "")
+
cmd.Flag.BoolVar(&buildA, "a", false, "")
cmd.Flag.BoolVar(&buildN, "n", false, "")
cmd.Flag.IntVar(&buildP, "p", buildP, "")
@@ -714,6 +719,12 @@ func (b *builder) build(a *action) error {
// install is the action for installing a single package or executable.
func (b *builder) install(a *action) error {
+
+ // OPENSUSE
+ if buildS && (a.p.Standard || a.p.ImportPath == "cmd/cgo") {
+ return nil
+ }
+
a1 := a.deps[0]
perm := os.FileMode(0666)
if a1.link {