summaryrefslogtreecommitdiff
path: root/debian/patches/004-dont_reinstall_dependencies_in_goinstall.patch
blob: 7752e210f01f8efd88edccca3583d07febb0bd8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
--- a/src/cmd/goinstall/main.go
+++ b/src/cmd/goinstall/main.go
@@ -21,6 +21,7 @@ import (
 )
 
 func usage() {
+	fmt.Fprintf(os.Stderr, "WARNING: Usage of goinstall is highly discouraged on Debian system. goinstall is not FHS friendly and it will possibly overwrite files from the package creating a highly unstable mess in /usr/lib/go. You have been warned!\n")
 	fmt.Fprint(os.Stderr, "usage: goinstall importpath...\n")
 	fmt.Fprintf(os.Stderr, "\tgoinstall -a\n")
 	flag.PrintDefaults()
@@ -43,6 +44,7 @@ var (
 	update            = flag.Bool("u", false, "update already-downloaded packages")
 	clean             = flag.Bool("clean", false, "clean the package directory before installing")
 	verbose           = flag.Bool("v", false, "verbose")
+	installDeps       = flag.Bool("d", false, "install package prerequisites")
 )
 
 type status int // status for visited map
@@ -189,7 +191,11 @@ func install(pkg, parent string) {
 	}
 	for _, p := range dirInfo.imports {
 		if p != "C" {
-			install(p, pkg)
+			if *installDeps {
+				install(p, pkg)
+			} else {
+				visit[p] = done
+			}
 		}
 	}
 	if dirInfo.pkgName == "main" {
--- a/src/cmd/goinstall/doc.go
+++ b/src/cmd/goinstall/doc.go
@@ -4,6 +4,11 @@
 
 /*
 
+WARNING: Usage of goinstall is highly discouraged on Debian system.
+goinstall is not FHS friendly and it will possibly overwrite files
+from the package creating a highly unstable mess in /usr/lib/go.
+You have been warned!
+
 Goinstall is an experiment in automatic package installation.
 It installs packages, possibly downloading them from the internet.
 It maintains a list of public Go packages at http://godashboard.appspot.com/package.
@@ -14,6 +19,7 @@ Usage:
 
 Flags and default settings:
         -a=false          install all previously installed packages
+        -d=false          install all package prerequisites (dangerous on Debian)
 	-clean=false      clean the package directory before installing
 	-dashboard=true   tally public packages on godashboard.appspot.com
 	-log=true         log installed packages to $GOROOT/goinstall.log for use by -a
@@ -21,9 +27,9 @@ Flags and default settings:
 	-v=false          verbose operation
 
 Goinstall installs each of the packages identified on the command line.  It
-installs a package's prerequisites before trying to install the package
-itself. Unless -log=false is specified, goinstall logs the import path of each
-installed package to $GOROOT/goinstall.log for use by goinstall -a.
+installs a package's prerequisites if given -d=true before trying to install
+the package itself. Unless -log=false is specified, goinstall logs the import
+path of each installed package to $GOROOT/goinstall.log for use by goinstall -a.
 
 If the -a flag is given, goinstall reinstalls all previously installed
 packages, reading the list from $GOROOT/goinstall.log.  After updating to a