summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authornavabi@google.com <navabi@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-14 07:23:30 +0000
committernavabi@google.com <navabi@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-14 07:23:30 +0000
commit4ba8681ee4be423a7e34becac6a1fa70d06481d1 (patch)
treedb588b80f1df413d4cb7950900648a104e2f1131 /build
parentdbac0014b1ff29c08bbcdb5a0872355a00646ffb (diff)
downloadchromium_src-4ba8681ee4be423a7e34becac6a1fa70d06481d1.zip
chromium_src-4ba8681ee4be423a7e34becac6a1fa70d06481d1.tar.gz
chromium_src-4ba8681ee4be423a7e34becac6a1fa70d06481d1.tar.bz2
Modify install script for java/ant based on trying on first upstream bot.
Upstream bots had errors installing from debian packages. I changed to download and install the same packages with sudo apt-get. Tested locally and on the upstream bot, and it seems to work. Need to test on "fresh" bot with no java or ant already installed. BUG=http://code.google.com/p/chromium/issues/detail?id=117023 TEST= Review URL: http://codereview.chromium.org/9655010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126604 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-xbuild/install-build-deps-android.sh75
1 files changed, 38 insertions, 37 deletions
diff --git a/build/install-build-deps-android.sh b/build/install-build-deps-android.sh
index 8077e8ea..5277a3b 100755
--- a/build/install-build-deps-android.sh
+++ b/build/install-build-deps-android.sh
@@ -8,11 +8,9 @@
# requires sudo privileges.
# See http://code.google.com/p/chromium/wiki/AndroidBuildInstructions
-DOWNLOAD_URL="http://ftp.us.debian.org/debian/pool/non-free/s/sun-java6"
-
-BIN_FILE_NAME="sun-java6-bin_6.26-0squeeze1_amd64.deb"
-JRE_FILE_NAME="sun-java6-jre_6.26-0squeeze1_all.deb"
-JDK_FILE_NAME="sun-java6-jdk_6.26-0squeeze1_amd64.deb"
+# This script installs the sun-java6 packages (bin, jre and jdk). Sun requires
+# a license agreement, so upon installation it will prompt the user. To get
+# past the curses-based dialog press TAB <ret> TAB <ret> to agree.
if ! uname -m | egrep -q "i686|x86_64"; then
echo "Only x86 architectures are currently supported" >&2
@@ -25,9 +23,7 @@ if [ "x$(id -u)" != x0 ]; then
echo
fi
-sudo apt-get update
-
-# The temporary directory used to store the downloaded file.
+# The temporary directory used to store output of update-java-alternatives
TEMPDIR=$(mktemp -d)
cleanup() {
local status=${?}
@@ -37,39 +33,44 @@ cleanup() {
}
trap cleanup EXIT
-##########################################################
-# Download (i.e. wget) and install debian package.
-# The current directory is changed in this function.
-# Arguments:
-# file_name
-# Returns:
-# None
-##########################################################
-install_deb_pkg() {
- local file_name="${1}"
- local download_url="${DOWNLOAD_URL}/${file_name}"
-
- cd "${TEMPDIR}"
- wget "${download_url}"
-
- echo "Install ${file_name}"
- sudo dpkg -i "${file_name}"
-}
-
-
-# Install ant
-sudo apt-get install python-pexpect ant
+sudo apt-get update
-# Install sun-java6-bin
-install_deb_pkg "${BIN_FILE_NAME}"
+# Fix deps
+sudo apt-get -f install
-# Install sun-java6-jre
-install_deb_pkg "${JRE_FILE_NAME}"
+# Install python-pexpect
+sudo apt-get install python-pexpect
-# Install sun-java6-jdk
-install_deb_pkg "${JDK_FILE_NAME}"
+# Install sun-java6 stuff
+sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk
# Switch version of Java to java-6-sun
-sudo update-java-alternatives -s java-6-sun
+# Sun's java is missing certain Java plugins (e.g. for firefox, mozilla). These
+# are not required to build, and thus are treated only as warnings. Any errors
+# in updating java alternatives which are not '*-javaplugin.so' will cause
+# errors and stop the script from completing successfully.
+if ! sudo update-java-alternatives -s java-6-sun \
+ >& "${TEMPDIR}"/update-java-alternatives.out
+then
+ # Check that there are the expected javaplugin.so errors for the update
+ if grep 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out >& /dev/null
+ then
+ # Print as warnings all the javaplugin.so errors
+ echo 'WARNING: java-6-sun has no alternatives for the following plugins:'
+ grep 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out
+ fi
+ # Check if there are any errors that are not javaplugin.so
+ if grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out \
+ >& /dev/null
+ then
+ # If there are non-javaplugin.so errors, treat as errors and exit
+ echo 'ERRORS: Failed to update alternatives for java-6-sun:'
+ grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out
+ exit 1
+ fi
+fi
+
+# Install ant
+sudo apt-get install ant
echo "install-build-deps-android.sh complete."