diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Contributions/manpages/brew.1.md | 6 | ||||
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 27 | ||||
| -rw-r--r-- | Library/Homebrew/utils.rb | 2 |
3 files changed, 30 insertions, 5 deletions
diff --git a/Library/Contributions/manpages/brew.1.md b/Library/Contributions/manpages/brew.1.md index b5184d055..b33c8c320 100644 --- a/Library/Contributions/manpages/brew.1.md +++ b/Library/Contributions/manpages/brew.1.md @@ -163,6 +163,12 @@ didn't include with OS X. If set, instructs Homebrew to always assume `--verbose` when running commands. + * HOMEBREW\_SVN: + When exporting from Subversion, Homebrew will use `HOMEBREW_SVN` if set, + a Homebrew-built Subversion if installed, or the system-provided binary. + + Set this to force Homebrew to use a particular svn binary. + ## SEE ALSO Homebrew Wiki: http://wiki.github.com/mxcl/homebrew/ diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 3ec36cb54..75ae64c1e 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -198,11 +198,30 @@ class SubversionDownloadStrategy <AbstractDownloadStrategy quiet_safe_system *args end - # Override this method in a DownloadStrategy to force the use of a non- - # system svn binary. mplayer.rb uses this to require a svn new enough to - # understand its externals. + # Try HOMEBREW_SVN, a Homebrew-built svn, and finally the OS X system svn. + # Not all features are available in the 10.5 system-provided svn. def svn - '/usr/bin/svn' + return ENV['HOMEBREW_SVN'] if ENV['HOMEBREW_SVN'] + return "#{HOMEBREW_PREFIX}/bin/svn" if File.exist? "#{HOMEBREW_PREFIX}/bin/svn" + return '/usr/bin/svn' + end +end + +# Require a newer version of Subversion than 1.4.x (Leopard-provided version) +class StrictSubversionDownloadStrategy <SubversionDownloadStrategy + def svn + exe = super + `#{exe} --version` =~ /version (\d+\.\d+(\.\d+)*)/ + svn_version = $1 + version_tuple=svn_version.split(".").collect {|v|Integer(v)} + + if version_tuple[0] == 1 and version_tuple[1] <= 4 + onoe "Detected Subversion (#{exe}, version #{svn_version}) is too old." + puts "Subversion 1.4.x will not export externals correctly for this formula." + puts "You must either `brew install subversion` or set HOMEBREW_SVN to the path" + puts "of a newer svn binary." + end + return exe end end diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 1de969939..d6170c323 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -255,7 +255,7 @@ def dump_build_env env puts "\"--use-llvm\" was specified" if ARGV.include? '--use-llvm' %w[ CC CXX LD CFLAGS CXXFLAGS CPPFLAGS LDFLAGS MACOSX_DEPLOYMENT_TARGET MAKEFLAGS PKG_CONFIG_PATH - HOMEBREW_DEBUG HOMEBREW_VERBOSE HOMEBREW_USE_LLVM ].each do |k| + HOMEBREW_DEBUG HOMEBREW_VERBOSE HOMEBREW_USE_LLVM HOMEBREW_SVN ].each do |k| value = env[k] puts "#{k}: #{value}" if value end |
