summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/patches/010-goinstall_check_conf.patch28
-rw-r--r--debian/patches/series1
2 files changed, 29 insertions, 0 deletions
diff --git a/debian/patches/010-goinstall_check_conf.patch b/debian/patches/010-goinstall_check_conf.patch
new file mode 100644
index 000000000..4d1f199cd
--- /dev/null
+++ b/debian/patches/010-goinstall_check_conf.patch
@@ -0,0 +1,28 @@
+--- a/src/cmd/goinstall/main.go
++++ b/src/cmd/goinstall/main.go
+@@ -35,7 +35,7 @@ var (
+ installedPkgs = make(map[string]bool)
+
+ allpkg = flag.Bool("a", false, "install all previously installed packages")
+- reportToDashboard = flag.Bool("dashboard", true, "report public packages at "+dashboardURL)
++ reportToDashboard *bool
+ logPkgs = flag.Bool("log", true, "log installed packages to $GOROOT/goinstall.log for use by -a")
+ update = flag.Bool("u", false, "update already-downloaded packages")
+ doInstall = flag.Bool("install", true, "build and install")
+@@ -45,6 +45,16 @@ var (
+ verbose = flag.Bool("v", false, "verbose")
+ )
+
++func init() {
++ d := true
++ b, err := ioutil.ReadFile("/etc/golang/goinstall.conf")
++ if err == nil {
++ re := regexp.MustCompile(`(^|\n)DASHBOARD="[nN][oO]"($|\n)`)
++ d = !re.Match(b)
++ }
++ reportToDashboard = flag.Bool("dashboard", d, "report public packages at "+dashboardURL)
++}
++
+ type status int // status for visited map
+ const (
+ unvisited status = iota
diff --git a/debian/patches/series b/debian/patches/series
index 68f6cd75c..af6055574 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@
007-use_native_dynamic_linker_on_kfreebsd.patch
008-emacs-mode-key-literal-indent.patch
009-goinstall_can_install_to_GOPATH.patch
+010-goinstall_check_conf.patch