]> Cypherpunks repositories - gostls13.git/commitdiff
misc/osx: update for dist tool, drop image.bash, update readme
authorAndrew Gerrand <adg@golang.org>
Tue, 7 Feb 2012 03:37:57 +0000 (14:37 +1100)
committerAndrew Gerrand <adg@golang.org>
Tue, 7 Feb 2012 03:37:57 +0000 (14:37 +1100)
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5639043

misc/osx/README
misc/osx/ReadMe.txt [deleted file]
misc/osx/image.bash [deleted file]
misc/osx/package.bash
misc/osx/utils.bash [deleted file]

index 87476dabc478e9b83bee319f667f30482cdf965d..2408dc4593e99e2065ecc882c1eb75fbdc8142aa 100644 (file)
@@ -1,9 +1,3 @@
-Use image.bash to construct a disk image.
+Use package.bash to construct a package file (Go.pkg) for installation on OS X.
 
-package.bash constructs a package file (Go.pkg) for installation on OS X, and
-is used by image.bash to construct a disk image. Strictly speaking, the disk
-image is unnecessary, but they are more common by convention.
-
-These scripts depend on PackageMaker (Developer Tools), osascript, and hdiutil.
-Appropriate checks are run in utils.bash, called at the beginning of each
-script.
+This script depends on PackageMaker (Developer Tools).
diff --git a/misc/osx/ReadMe.txt b/misc/osx/ReadMe.txt
deleted file mode 100644 (file)
index d8de1db..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-See http://golang.org/doc/go_tutorial.html for help getting started. Note that
-the installation steps described in the "getting started" guide are performed
-for you by the installer packaged in this directory.
-
diff --git a/misc/osx/image.bash b/misc/osx/image.bash
deleted file mode 100755 (executable)
index ff8f761..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-set -e
-
-source utils.bash
-
-if ! test -f ../../src/env.bash; then
-       echo "package.bash must be run from $GOROOT/misc/osx" 1>&2
-fi
-
-ROOT=`hg root`
-
-echo "Running package.bash"
-./package.bash
-
-echo "Preparing image directory"
-IMGDIR=/tmp/"Go `hg id`"
-rm -rf "${IMGDIR}"
-mkdir -p "${IMGDIR}"
-
-# Copy in files
-cp "Go `hg id`.pkg" "${IMGDIR}/Go.pkg"
-cp ${ROOT}/LICENSE "${IMGDIR}/License.txt"
-cp ReadMe.txt "${IMGDIR}/ReadMe.txt"
-cp "${ROOT}/doc/gopher/bumper640x360.png" "${IMGDIR}/.background"
-
-# Call out to applescript (osascript) to prettify things
-#${OSASCRIPT} prepare.applescript
-
-echo "Creating dmg"
-${HDIUTIL} create -srcfolder "${IMGDIR}" "Go `hg id`.dmg"
-
-echo "Removing image directory"
-rm -rf ${IMGDIR}
-
index 708494eb2e38313db73a6bac1b2b0f50edbba4e5..d4ee5f48fc1e3dc20f4737f1ce98797dbd795876 100755 (executable)
@@ -5,45 +5,65 @@
 
 set -e
 
-source utils.bash
+if ! test -f ../../src/all.bash; then
+       echo >&2 "package.bash must be run from $GOROOT/misc/osx"
+       exit 1
+fi
 
-if ! test -f ../../src/env.bash; then
-       echo "package.bash must be run from $GOROOT/misc/osx" 1>&2
+echo >&2 "Locating PackageMaker..."
+PM=/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
+if [ ! -x $PM ]; then
+       PM=/Developer$PM
+       if [ ! -x $PM ]; then
+               echo >&2 "could not find PackageMaker; aborting"
+               exit 1
+       fi
 fi
+echo >&2 "  Found: $PM"
 
 BUILD=/tmp/go.build.tmp
 ROOT=`hg root`
 export GOROOT=$BUILD/root/usr/local/go
 export GOROOT_FINAL=/usr/local/go
 
-echo "Removing old images"
+echo >&2 "Removing old images"
 rm -f *.pkg *.dmg
 
-echo "Preparing temporary directory"
+echo >&2 "Preparing temporary directory"
 rm -rf $BUILD
 mkdir -p $BUILD
+trap "rm -rf $BUILD" 0
 
-echo "Copying go source distribution"
+echo >&2 "Copying go source distribution"
 mkdir -p $BUILD/root/usr/local
 cp -r $ROOT $GOROOT
 cp -r etc $BUILD/root/etc
 
-echo "Building go"
 pushd $GOROOT > /dev/null
-src/version.bash -save
+
+echo >&2 "Detecting version..."
+pushd src > /dev/null
+./make.bash --dist-tool > /dev/null
+../bin/tool/dist version > /dev/null
+popd > /dev/null
+mv VERSION.cache VERSION
+VERSION="$(cat VERSION | awk '{ print $1 }')"
+echo >&2 "  Version: $VERSION"
+
+echo >&2 "Pruning Mercurial metadata"
 rm -rf .hg .hgignore .hgtags
-cd src
-./all.bash | sed "s/^/  /"
+
+echo >&2 "Building Go"
+pushd src
+./all.bash 2>&1 | sed "s/^/  /" >&2
 popd > /dev/null
 
-echo "Building package"
-# $PM came from utils.bahs
-$PM -v -r $BUILD/root -o "Go `hg id`.pkg" \
+popd > /dev/null
+
+echo >&2 "Building package"
+$PM -v -r $BUILD/root -o "go.darwin.$VERSION.pkg" \
        --scripts scripts \
        --id com.googlecode.go \
        --title Go \
        --version "0.1" \
        --target "10.5"
-
-echo "Removing temporary directory"
-rm -rf $BUILD
diff --git a/misc/osx/utils.bash b/misc/osx/utils.bash
deleted file mode 100644 (file)
index 022a0bd..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-set -e
-
-echo "Attempting to locate needed utilities..."
-
-# PackageMaker
-PM=/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
-if [ ! -x ${PM} ]; then
-       PM=/Developer${PM}
-       if [ ! -x ${PM} ]; then
-               echo "Could not find PackageMaker; aborting!"
-       fi
-fi
-echo "  PackageMaker : ${PM}"
-
-# hdiutil. If this doesn't exist, your OS X installation is horribly borked,
-# but let's check anyway...
-if which hdiutil > /dev/null; then
-       HDIUTIL=`which hdiutil`
-       echo "  hdiutil      : ${HDIUTIL}"
-fi
-
-# Ditto for osascript
-if which osascript > /dev/null; then
-       OSASCRIPT=`which osascript`
-       echo "  osascript    : ${OSASCRIPT}"
-fi