From 380d7b1df2b444dbcbc6e7b48c36822c9d96ee27 Mon Sep 17 00:00:00 2001 From: "torne@chromium.org" Date: Tue, 15 Jan 2013 22:11:47 +0000 Subject: [PATCH] Add unsupported option to install-build-deps. Add an option --unsupported to install-build-deps.sh which allows the installation to be attempted on a system we don't support. Omit mentioning this in the error, in the hope that anyone who can deal with the fallout from this will find it in the script. Also, add GCEL (Ubuntu-derived image used by Compute Engine) to the list of supported systems. BUG= Review URL: https://codereview.chromium.org/11863012 git-svn-id: http://src.chromium.org/svn/trunk/src/build@176982 4ff67af0-8c30-449e-8e8b-ad334ec8d88c --- install-build-deps.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/install-build-deps.sh b/install-build-deps.sh index 4d1045190..c891f2709 100755 --- a/install-build-deps.sh +++ b/install-build-deps.sh @@ -31,6 +31,7 @@ do --no-prompt) do_default=1 do_quietly="-qq --assume-yes" ;; + --unsupported) do_unsupported=1;; *) usage;; esac shift @@ -38,16 +39,23 @@ done ubuntu_versions="10\.04|10\.10|11\.04|11\.10|12\.04|12\.10" ubuntu_codenames="lucid|maverick|natty|oneiric|precise|quantal" +ubuntu_issue="Ubuntu ($ubuntu_versions|$ubuntu_codenames)" +# GCEL is an Ubuntu-derived VM image used on Google Compute Engine; /etc/issue +# doesn't contain a version number so just trust that the user knows what +# they're doing. +gcel_issue="^GCEL" -if ! egrep -q "Ubuntu ($ubuntu_versions|$ubuntu_codenames)" /etc/issue; then - echo "ERROR: Only Ubuntu 10.04 (lucid) through 12.10 (quantal) are currently"\ - "supported" >&2 - exit 1 -fi +if [ 0 -eq "${do_unsupported-0}" ] ; then + if ! egrep -q "($ubuntu_issue|$gcel_issue)" /etc/issue; then + echo "ERROR: Only Ubuntu 10.04 (lucid) through 12.10 (quantal) are"\ + "currently supported" >&2 + exit 1 + fi -if ! uname -m | egrep -q "i686|x86_64"; then - echo "Only x86 architectures are currently supported" >&2 - exit + if ! uname -m | egrep -q "i686|x86_64"; then + echo "Only x86 architectures are currently supported" >&2 + exit + fi fi if [ "x$(id -u)" != x0 ]; then