~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to debian/patches/010-goinstall_check_conf.patch

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--- a/src/cmd/goinstall/main.go
2
 
+++ b/src/cmd/goinstall/main.go
3
 
@@ -38,7 +38,7 @@ var (
4
 
        schemeRe      = regexp.MustCompile(`^[a-z]+://`)
5
 
 
6
 
        allpkg            = flag.Bool("a", false, "install all previously installed packages")
7
 
-       reportToDashboard = flag.Bool("dashboard", true, "report public packages at "+dashboardURL)
8
 
+       reportToDashboard *bool
9
 
        update            = flag.Bool("u", false, "update already-downloaded packages")
10
 
        doGofix           = flag.Bool("fix", false, "gofix each package before building it")
11
 
        doInstall         = flag.Bool("install", true, "build and install")
12
 
@@ -48,6 +48,16 @@ var (
13
 
        verbose           = flag.Bool("v", false, "verbose")
14
 
 )
15
 
 
16
 
+func init() {
17
 
+       d := true
18
 
+       b, err := ioutil.ReadFile("/etc/golang/goinstall.conf")
19
 
+       if err == nil {
20
 
+               re := regexp.MustCompile(`(^|\n)DASHBOARD="[nN][oO]"($|\n)`)
21
 
+               d = !re.Match(b)
22
 
+       }
23
 
+       reportToDashboard = flag.Bool("dashboard", d, "report public packages at "+dashboardURL)
24
 
+}
25
 
+
26
 
 type status int // status for visited map
27
 
 const (
28
 
        unvisited status = iota