summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTianon Gravi <admwiggin@gmail.com>2015-05-02 16:47:28 -0600
committerTianon Gravi <admwiggin@gmail.com>2015-05-03 01:23:23 -0600
commit5448d99071d9a05fa0541557e8e8277b84303b08 (patch)
treef9b1857cb9b6a63566c1dced335b7f9c3764ab1f
parentd9a0e443c808394c3c4d0d907d24e0ffbe318d00 (diff)
downloadgolang-5448d99071d9a05fa0541557e8e8277b84303b08.tar.gz
Move "go" and "gofmt" into "/usr/lib/go" and use alternatives to provide appropriate symlinks (Closes: #779503, #782301)
-rw-r--r--debian/changelog7
-rw-r--r--debian/golang-go.dirs1
-rw-r--r--debian/golang-go.install4
-rw-r--r--debian/golang-go.postinst11
4 files changed, 18 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog
index 1e893884a..5b8412ac7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+golang (2:1.4.2-2) UNRELEASED; urgency=medium
+
+ * Move "go" and "gofmt" into "/usr/lib/go" and use alternatives to provide
+ appropriate symlinks (Closes: #779503, #782301).
+
+ -- Tianon Gravi <admwiggin@gmail.com> Sat, 02 May 2015 22:39:22 +0000
+
golang (2:1.4.2-1) unstable; urgency=medium
* New upstream version
diff --git a/debian/golang-go.dirs b/debian/golang-go.dirs
index 33522f9a3..c5607849e 100644
--- a/debian/golang-go.dirs
+++ b/debian/golang-go.dirs
@@ -1,3 +1,2 @@
-usr/bin
usr/lib/go
usr/share/go/src/
diff --git a/debian/golang-go.install b/debian/golang-go.install
index f0ab2f765..c819e3447 100644
--- a/debian/golang-go.install
+++ b/debian/golang-go.install
@@ -1,5 +1,5 @@
-bin/go /usr/bin
-bin/gofmt /usr/bin
+bin/go /usr/lib/go/bin/
+bin/gofmt /usr/lib/go/bin/
pkg/obj /usr/lib/go/pkg/
pkg/tool /usr/lib/go/pkg/
VERSION /usr/lib/go/
diff --git a/debian/golang-go.postinst b/debian/golang-go.postinst
index 2f5bd34fb..6a6081ee0 100644
--- a/debian/golang-go.postinst
+++ b/debian/golang-go.postinst
@@ -19,8 +19,15 @@ case "$1" in
rm -f $conffile
rmdir /etc/golang || true
fi
- # Very ugly hack to set timestamps same as /usr/bin/go
- find /usr/lib/go/pkg -exec touch -r /usr/bin/go {} \;
+ # Very ugly hack to set timestamps same as /usr/lib/go/bin/go
+ find /usr/lib/go/pkg -exec touch -r /usr/lib/go/bin/go {} \;
+ # Setup alternatives
+ # Priority: base of 100 + go version; 1.4.2 = 100 + 42)
+ go=$(/usr/lib/go/bin/go version | awk '{ gsub(/^go1|[.]/, "", $3); print $3 }')
+ priority=$(( 100 + $go ))
+ update-alternatives \
+ --install /usr/bin/go go /usr/lib/go/bin/go $priority \
+ --slave /usr/bin/gofmt gofmt /usr/lib/go/bin/gofmt
;;
*)
;;