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

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

Issue 151113: Don't screw up /usr/bin/ld if you can't write to current dir as root.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 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
===================================================================
--- build/install-build-deps.sh (revision 19615)
+++ build/install-build-deps.sh (working copy)
@@ -8,6 +8,15 @@
# Gold is optional; it's a faster replacement for ld,
# and makes life on 2GB machines much more pleasant.
+ # First make sure root can access this directory, as that's tripped up some folks.
+ if sudo touch xyz.$$
+ then
+ sudo rm xyz.$$
+ else
+ echo root cannot write to the current directory, not installing gold
+ return
+ fi
+
BINUTILS=binutils-2.19.1
BINUTILS_URL=http://ftp.gnu.org/gnu/binutils/$BINUTILS.tar.bz2
BINUTILS_SHA1=88c91e36cde93433e4c4c2b2e3417777aad84526
@@ -46,16 +55,19 @@
patch -p1 < ../binutils-fix.patch
./configure --prefix=/usr/local/gold --enable-gold
make -j3
- sudo make install
-
- # Still need to figure out graceful way of pointing gyp to use
- # /usr/local/gold/bin/ld without requiring him to set environment
- # variables. That will go into bootstrap-linux.sh when it's ready.
- echo "Installing gold as /usr/bin/ld."
- echo "To uninstall, do 'cd /usr/bin; sudo rm ld; sudo mv ld.orig ld'"
- test -f /usr/bin/ld && sudo mv /usr/bin/ld /usr/bin/ld.orig
- sudo ln -fs /usr/local/gold/bin/ld /usr/bin/ld.gold
- sudo ln -fs /usr/bin/ld.gold /usr/bin/ld
+ if sudo make install
+ then
+ # Still need to figure out graceful way of pointing gyp to use
+ # /usr/local/gold/bin/ld without requiring him to set environment
+ # variables. That will go into bootstrap-linux.sh when it's ready.
+ echo "Installing gold as /usr/bin/ld."
+ echo "To uninstall, do 'cd /usr/bin; sudo rm ld; sudo mv ld.orig ld'"
+ test -f /usr/bin/ld && sudo mv /usr/bin/ld /usr/bin/ld.orig
+ sudo ln -fs /usr/local/gold/bin/ld /usr/bin/ld.gold
+ sudo ln -fs /usr/bin/ld.gold /usr/bin/ld
+ else
+ make install failed, not installing gold
Paweł Hajdan Jr. 2009/06/30 23:36:12 Shouldn't that be echo?
+ fi
}
if ! egrep -q "Ubuntu 8.04|Ubuntu 8.10|Ubuntu 9.04" /etc/issue; then
@@ -216,7 +228,7 @@
Dir::State::Lists "${tmp}/apt/lists/";
Dir::State::status "${tmp}/status";
EOF
-
+
# Download 32bit packages
echo "Computing list of available 32bit packages..."
apt-get -c="${tmp}/apt/apt.conf" update
Property changes on: build/install-build-deps.sh
___________________________________________________________________
Name: svn:eol-style
+ LF
« 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