Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(722)

Unified Diff: build/install-build-deps.sh

Issue 298863006: Use lsb_release in install-build-deps.sh to determine linux distro. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/install-build-deps.sh
diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh
index ed4dbd6b243ccfbb2d1b1818cf55a0763a20cf8d..f3b7eba2c78d9386548ccab4073b97addeadeca4 100755
--- a/build/install-build-deps.sh
+++ b/build/install-build-deps.sh
@@ -63,16 +63,16 @@ do
shift
done
-ubuntu_versions="12\.04|12\.10|13\.04|13\.10|14\.04"
-ubuntu_codenames="precise|quantal|raring|saucy|trusty"
-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"
+# Check for lsb_release command in $PATH
+if ! which lsb_release > /dev/null; then
+ echo "ERROR: lsb_release not found in \$PATH" >&2
+ exit 1;
+fi
+lsb_release=$(lsb_release --codename --short)
+ubuntu_codenames="(precise|quantal|raring|saucy|trusty)"
if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then
- if ! egrep -q "($ubuntu_issue|$gcel_issue)" /etc/issue; then
+ if [[ ! $lsb_release =~ $ubuntu_codenames ]]; then
echo "ERROR: Only Ubuntu 12.04 (precise) through 14.04 (trusty) are"\
"currently supported" >&2
exit 1
@@ -243,8 +243,7 @@ fi
# that are part of v8 need to be compiled with -m32 which means
# that basic multilib support is needed.
if file /sbin/init | grep -q 'ELF 64-bit'; then
- # TODO(thestig): Use lsb_release rather than looking /etc/issue.
- if ! egrep -q "trusty" /etc/issue; then
+ if [ "$lsb_release" = "trusty" ]; then
# gcc-multilib conflicts with the arm cross compiler in trusty but
# g++-4.8-multilib gives us the 32-bit support that we need.
arm_list="$arm_list g++-4.8-multilib"
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698