OLD | NEW |
---|---|
1 #!/bin/bash -e | 1 #!/bin/bash -e |
2 | 2 |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Script to install everything needed to build chromium on android that | 7 # Script to install everything needed to build chromium on android that |
8 # requires sudo privileges. | 8 # requires sudo privileges. |
9 # See http://code.google.com/p/chromium/wiki/AndroidBuildInstructions | 9 # See http://code.google.com/p/chromium/wiki/AndroidBuildInstructions |
10 | 10 |
11 # This script installs the sun-java6 packages (bin, jre and jdk). Sun requires | 11 # This script installs the sun-java6 packages (bin, jre and jdk). Sun requires |
12 # a license agreement, so upon installation it will prompt the user. To get | 12 # a license agreement, so upon installation it will prompt the user. To get |
13 # past the curses-based dialog press TAB <ret> TAB <ret> to agree. | 13 # past the curses-based dialog press TAB <ret> TAB <ret> to agree. |
14 | 14 |
15 if ! uname -m | egrep -q "i686|x86_64"; then | 15 if ! uname -m | egrep -q "i686|x86_64"; then |
16 echo "Only x86 architectures are currently supported" >&2 | 16 echo "Only x86 architectures are currently supported" >&2 |
17 exit | 17 exit |
18 fi | 18 fi |
19 | 19 |
20 if [ "x$(id -u)" != x0 ]; then | 20 # Install first the default Linux build deps. |
21 echo "Running as non-root user." | 21 "$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \ |
Nico
2014/04/03 20:19:56
Is `$(dirname "${0}") enough? It's not like there'
Primiano Tucci (use gerrit)
2014/04/03 20:54:10
I think the difference between $0 vs $BASH_SOURCE
Nico
2014/04/03 20:58:36
We use $0 in a bunch of places, and I never heard
Primiano Tucci (use gerrit)
2014/04/03 21:30:31
~ $ cat foo
#!/bin/bash
echo My dir-1 is $(dirname
| |
22 echo "You might have to enter your password one or more times for 'sudo'." | 22 --no-syms --no-arm --no-chromeos-fonts --no-nacl --no-prompt |
23 echo | |
24 fi | |
25 | 23 |
26 # The temporary directory used to store output of update-java-alternatives | 24 # The temporary directory used to store output of update-java-alternatives |
27 TEMPDIR=$(mktemp -d) | 25 TEMPDIR=$(mktemp -d) |
28 cleanup() { | 26 cleanup() { |
29 local status=${?} | 27 local status=${?} |
30 trap - EXIT | 28 trap - EXIT |
31 rm -rf "${TEMPDIR}" | 29 rm -rf "${TEMPDIR}" |
32 exit ${status} | 30 exit ${status} |
33 } | 31 } |
34 trap cleanup EXIT | 32 trap cleanup EXIT |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
95 then | 93 then |
96 # If there are non-javaplugin.so errors, treat as errors and exit | 94 # If there are non-javaplugin.so errors, treat as errors and exit |
97 echo 'ERRORS: Failed to update alternatives for java-6-sun:' | 95 echo 'ERRORS: Failed to update alternatives for java-6-sun:' |
98 grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out | 96 grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out |
99 exit 1 | 97 exit 1 |
100 fi | 98 fi |
101 fi | 99 fi |
102 fi | 100 fi |
103 | 101 |
104 echo "install-build-deps-android.sh complete." | 102 echo "install-build-deps-android.sh complete." |
OLD | NEW |