From cb3ffba6351f8874115138bc08f723bb1a3d557c Mon Sep 17 00:00:00 2001 From: Max Howell Date: Tue, 23 Aug 2011 22:01:27 +0100 Subject: [PATCH] Revert "Ensure that we undo the o+w chmod" This reverts commit b3d5ac0c8500006ef4fbd0bf3bd53b22a06869ab. --- install_homebrew.rb | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/install_homebrew.rb b/install_homebrew.rb index c172f058f1..f77aa947c7 100644 --- a/install_homebrew.rb +++ b/install_homebrew.rb @@ -114,24 +114,23 @@ end sudo "/bin/mkdir /usr/local" unless File.directory? "/usr/local" sudo "/bin/chmod o+w /usr/local" -begin - sudo "/bin/chmod", "g+w", *chmods unless chmods.empty? - sudo "/usr/bin/chgrp", "staff", *chgrps unless chgrps.empty? - system "/bin/mkdir", *root_dirs unless root_dirs.empty? +sudo "/bin/chmod", "g+w", *chmods unless chmods.empty? +sudo "/usr/bin/chgrp", "staff", *chgrps unless chgrps.empty? +system "/bin/mkdir", *root_dirs unless root_dirs.empty? - Dir.chdir "/usr/local" do - ohai "Downloading and Installing Homebrew..." - # -m to stop tar erroring out if it can't modify the mtime for root owned directories - # pipefail to cause the exit status from curl to propogate if it fails - system "/bin/bash -o pipefail -c '/usr/bin/curl -sSfL https://github.com/mxcl/homebrew/tarball/master | /usr/bin/tar xz -m --strip 1'" - end -ensure - # we reset the permissions of /usr/local because we want to minimise the - # amount of fiddling we do to the system. Some tools require /usr/local to - # be by non-writable for non-root users. - sudo "/bin/chmod o-w /usr/local" + +Dir.chdir "/usr/local" do + ohai "Downloading and Installing Homebrew..." + # -m to stop tar erroring out if it can't modify the mtime for root owned directories + # pipefail to cause the exit status from curl to propogate if it fails + system "/bin/bash -o pipefail -c '/usr/bin/curl -sSfL https://github.com/mxcl/homebrew/tarball/master | /usr/bin/tar xz -m --strip 1'" end +# we reset the permissions of /usr/local because we want to minimise the +# amount of fiddling we do to the system. Some tools require /usr/local to be +# by non-writable for non-root users. +sudo "/bin/chmod o-w /usr/local" + warn "/usr/local/bin is not in your PATH." unless ENV['PATH'].split(':').include? '/usr/local/bin' warn "Now install Xcode: http://developer.apple.com/technologies/xcode.html" unless Kernel.system "/usr/bin/which -s gcc"