mxcl/homebrew — pull request #14710 by dch (2012-09-04 20:40:58+00:00)
Title: Fix files moving into place across filesystem mountpoints

When Cellar and /Library/Caches/Homebrew are on different filesystems,
FileUtils.mv does not succeed. Use Kernel.system instead.

Patch suggested by @mistydemeo.

Stack trace from failing install of rbenv follows:

```
bash
bash-3.2$ brew install -v --debug rbenv
/usr/local/bin/brew: loading /usr/local/Library/Formula/rbenv.rb
==> Downloading https://github.com/sstephenson/rbenv/tarball/v0.3.0
Already downloaded: /Library/Caches/Homebrew/rbenv-0.3.0.tgz
/usr/bin/tar xf /Library/Caches/Homebrew/rbenv-0.3.0.tgz
Error: #
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1277:in `utime'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1277:in `copy_metadata'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:453:in `copy_entry'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1331:in `traverse'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:449:in `copy_entry'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:508:in `mv'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1402:in `fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1416:in `fu_each_src_dest0'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1400:in `fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:495:in `mv'
/usr/local/Library/Homebrew/extend/pathname.rb:61:in `install_p'
/usr/local/Library/Homebrew/extend/pathname.rb:20:in `install'
/usr/local/Library/Homebrew/extend/pathname.rb:20:in `each'
/usr/local/Library/Homebrew/extend/pathname.rb:20:in `install'
/usr/local/Library/Homebrew/extend/pathname.rb:13:in `each'
/usr/local/Library/Homebrew/extend/pathname.rb:13:in `install'
/usr/local/Library/Formula/rbenv.rb:11:in `install'
/usr/local/Library/Homebrew/build.rb:143:in `install'
/usr/local/Library/Homebrew/formula.rb:221:in `brew'
/usr/local/Library/Homebrew/formula.rb:532:in `stage'
/usr/local/Library/Homebrew/extend/fileutils.rb:21:in `mktemp'
/usr/local/Library/Homebrew/formula.rb:528:in `stage'
/usr/local/Library/Homebrew/formula.rb:216:in `brew'
/usr/local/Library/Homebrew/build.rb:123:in `install'
/usr/local/Library/Homebrew/build.rb:42:in `main'
/usr/local/Library/Homebrew/build.rb:12
/usr/local/Library/Formula/rbenv.rb:14
==> Rescuing build...
When you exit this shell Homebrew will attempt to finalise the installation.
If nothing is installed or the shell exits with a non-zero error code,
Homebrew will abort. The installation prefix is:
/usr/local/Cellar/rbenv/0.3.0
```