summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-05-23 10:29:00 +0200
committerOndřej Surý <ondrej@sury.org>2011-05-23 11:06:59 +0200
commit708325280a9e36c0622a7cdd1fee251d10a2a191 (patch)
tree49a8be6af95ec41fdd08afda6409c6a08728cb3e
parente7f22532f2c617a1337926aaf568d38d968f82cb (diff)
downloadgolang-708325280a9e36c0622a7cdd1fee251d10a2a191.tar.gz
Import slightly modified patch to be more clear about $GOPATH installs for non-root users
-rw-r--r--debian/patches/009-goinstall_can_install_to_GOPATH.patch17
-rw-r--r--debian/patches/010-dont_update_standard_packages.patch13
-rw-r--r--debian/patches/series2
3 files changed, 32 insertions, 0 deletions
diff --git a/debian/patches/009-goinstall_can_install_to_GOPATH.patch b/debian/patches/009-goinstall_can_install_to_GOPATH.patch
new file mode 100644
index 000000000..e15458185
--- /dev/null
+++ b/debian/patches/009-goinstall_can_install_to_GOPATH.patch
@@ -0,0 +1,17 @@
+--- a/src/cmd/goinstall/main.go
++++ b/src/cmd/goinstall/main.go
+@@ -61,6 +61,14 @@ func main() {
+ }
+ root += filepath.FromSlash("/src/pkg/")
+
++ if os.Getuid() != 0 && os.Getenv("GOPATH") == "" {
++ fmt.Fprintf(os.Stderr, "%s: set $GOPATH to the directory you want packages installed to if you get permission denied error\n", argv0)
++ }
++
++ if root != defaultRoot.path {
++ logfile = filepath.Join(defaultRoot.path, "goinstall.log")
++ }
++
+ // special case - "unsafe" is already installed
+ visit["unsafe"] = done
+
diff --git a/debian/patches/010-dont_update_standard_packages.patch b/debian/patches/010-dont_update_standard_packages.patch
new file mode 100644
index 000000000..94d6f3e28
--- /dev/null
+++ b/debian/patches/010-dont_update_standard_packages.patch
@@ -0,0 +1,13 @@
+--- a/src/cmd/goinstall/main.go
++++ b/src/cmd/goinstall/main.go
+@@ -169,8 +169,8 @@ func install(pkg, parent string) {
+ dir = pkg
+ local = true
+ } else if isStandardPath(pkg) {
+- dir = filepath.Join(root, filepath.FromSlash(pkg))
+- local = true
++ visit[pkg] = done
++ return
+ } else {
+ proot = findPkgroot(pkg)
+ err := download(pkg, proot.srcDir())
diff --git a/debian/patches/series b/debian/patches/series
index 47b482f66..4b2b2d632 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,5 @@
006-fix_kfreebsd_build.patch
007-use_native_dynamic_linker_on_kfreebsd.patch
008-emacs-mode-key-literal-indent.patch
+009-goinstall_can_install_to_GOPATH.patch
+010-dont_update_standard_packages.patch