diff options
author | dkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-06 21:10:58 +0000 |
---|---|---|
committer | dkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-06 21:10:58 +0000 |
commit | 79a9d2969a4b34d2ecd7051ac08a19a2ec92e0e2 (patch) | |
tree | 53ab54e2f7aa230b170c8e823e5b313812c49e8d | |
parent | 9edd6e1119f6a22fd475a18df105d5ad34ad6d00 (diff) | |
download | chromium_src-79a9d2969a4b34d2ecd7051ac08a19a2ec92e0e2.zip chromium_src-79a9d2969a4b34d2ecd7051ac08a19a2ec92e0e2.tar.gz chromium_src-79a9d2969a4b34d2ecd7051ac08a19a2ec92e0e2.tar.bz2 |
Report apt-get failures in install-build-deps.sh
Patch from gmatht, originally reviewed at
http://codereview.chromium.org/160630
Review URL: http://codereview.chromium.org/164091
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22665 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | build/install-build-deps.sh | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh index de293f9..a7d5198 100755 --- a/build/install-build-deps.sh +++ b/build/install-build-deps.sh @@ -168,15 +168,36 @@ sudo apt-get update # without accidentally promoting any packages from "auto" to "manual". # We then re-run "apt-get" with just the list of missing packages. echo "Finding missing packages..." -new_list="$(yes n | - LANG=C sudo apt-get install --reinstall \ - ${dev_list} ${lib_list} ${dbg_list} \ - $([ "$(uname -m)" = x86_64 ] && echo ${cmp_list}) \ - | - sed -e '1,/The following NEW packages will be installed:/d;s/^ //;t;d')" +packages="${dev_list} ${lib_list} ${dbg_list} + $([ "$(uname -m)" = x86_64 ] && echo ${cmp_list})" +echo "Packages required: $packages" +new_list_cmd="sudo apt-get install --reinstall $(echo $packages)" +if new_list="$(yes n | LANG=C $new_list_cmd)" +then + echo "No missing packages, and the packages are up-to-date." +elif [ $? -eq 1 ] +then + # We expect apt-get to have exit status of 1. + # This indicates that we canceled the install with "yes n|". + new_list=$(echo $new_list | + sed -e '1,/The following NEW packages will be installed:/d;s/^ //;t;d') + echo "Installing missing packages: $new_list." + sudo apt-get install ${new_list} +else + # An apt-get exit status of 100 indicates that a real error has occurred. -echo "Installing missing packages..." -sudo apt-get install ${new_list} + # I am intentionally leaving out the '"'s around new_list_cmd, + # as this makes it easier to cut and paste the output + echo + echo "The following command failed: " ${new_list_cmd} + echo + echo "It produces the following output:" + yes n | $new_list_cmd || true + echo + echo "You will have to install the above packages yourself." + echo + exit 100 +fi # Some operating systems already ship gold # (on Debian, you can probably do "apt-get install binutils-gold" to get it), @@ -222,12 +243,12 @@ if [ "$(uname -m)" = x86_64 ]; then [ -r /etc/apt/apt.conf ] && cp /etc/apt/apt.conf "${tmp}/apt/" cat >>"${tmp}/apt/apt.conf" <<-EOF - Apt::Architecture "i386"; - Dir::Cache "${tmp}/cache"; - Dir::Cache::Archives "${tmp}/"; - Dir::State::Lists "${tmp}/apt/lists/"; - Dir::State::status "${tmp}/status"; - EOF + Apt::Architecture "i386"; + Dir::Cache "${tmp}/cache"; + Dir::Cache::Archives "${tmp}/"; + Dir::State::Lists "${tmp}/apt/lists/"; + Dir::State::status "${tmp}/status"; + EOF # Download 32bit packages echo "Computing list of available 32bit packages..." |