Chromium Code Reviews| Index: build/install-build-deps-android.sh |
| diff --git a/build/install-build-deps-android.sh b/build/install-build-deps-android.sh |
| index 5d9043944a0e04c964c7a25a24d0b34c22d3743d..d89e1e1e25917090789798ea66dceef6e8f253d6 100755 |
| --- a/build/install-build-deps-android.sh |
| +++ b/build/install-build-deps-android.sh |
| @@ -39,34 +39,59 @@ sudo apt-get update |
| sudo apt-get -f install |
| # Install deps |
| -sudo apt-get -y install python-pexpect ant1.8 xvfb x11-utils |
| - |
| -# Install sun-java6 stuff |
| -sudo apt-get -y install sun-java6-bin sun-java6-jre sun-java6-jdk |
| - |
| -# Switch version of Java to 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 |
| +# This step differs depending on what Ubuntu release we are running |
| +# on since the package names are different, and Sun's Java must |
| +# be installed manually on late-model versions. |
| + |
| +if /usr/bin/lsb_release -r -s | egrep -q "12."; then |
|
Peter Beverloo
2012/09/21 20:01:46
There's no regular expression in here, so we can u
|
| + # Ubuntu 12.x |
| + sudo apt-get -y install python-pexpect ant xvfb x11-utils |
|
Peter Beverloo
2012/09/21 20:01:46
The python-pexpect, xvfb and x11-utils packages ar
|
| + |
| + # Java can not be installed via ppa on Ubuntu 12.04+ so we'll |
| + # simply check to see if it has been setup properly -- if not |
| + # let the user know. |
| + |
| + if ! java -version 2>&1 | egrep -q "Java\(TM\)"; then |
|
Peter Beverloo
2012/09/21 20:01:46
This can be "grep" as well, then you don't have to
|
| + echo "****************************************************************" |
| + echo "You need to install the Oracle Java SDK from http://goo.gl/uPRSq" |
| + echo "and configure it as the default command-line Java environment." |
| + echo "****************************************************************" |
| + exit |
| fi |
| - # Check if there are any errors that are not javaplugin.so |
| - if grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out \ |
| - >& /dev/null |
| + |
| +else |
| + # Ubuntu 10.x |
| + |
| + sudo apt-get -y install python-pexpect ant1.8 xvfb x11-utils |
| + |
| + # Install sun-java6 stuff |
| + sudo apt-get -y install sun-java6-bin sun-java6-jre sun-java6-jdk |
| + |
| + # Switch version of Java to 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 |
| - # 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 |
| + # 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 |
| fi |