HttpDownloadStrategy renamed CurlDownloadStrategy

Because people didn't realise it was actually curl and thus supports eg. ftp too.
This commit is contained in:
Max Howell 2009-10-02 18:36:58 +01:00
parent 5f0d2dc032
commit c130cf3e71
3 changed files with 20 additions and 11 deletions

View File

@ -35,9 +35,15 @@ require 'hardware'
ENV['MACOSX_DEPLOYMENT_TARGET']=MACOS_VERSION.to_s
# ignore existing build vars, thus we should have less bugs to deal with
ENV['LDFLAGS'] = ''
ENV['CPPFLAGS'] = ''
unless HOMEBREW_PREFIX.to_s == '/usr/local'
# /usr/local is always in the build system path so only add other paths
ENV['CPPFLAGS'] = "-I#{HOMEBREW_PREFIX}/include"
ENV['LDFLAGS'] = "-L#{HOMEBREW_PREFIX}/lib"
else
# ignore existing build vars, thus we should have less bugs to deal with
ENV['CPPFLAGS'] = ''
ENV['LDFLAGS'] = ''
end
if MACOS_VERSION >= 10.6 or ENV['HOMEBREW_USE_LLVM']
ENV['CC'] = '/Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2'
@ -93,12 +99,6 @@ ENV['CFLAGS']=ENV['CXXFLAGS']="#{cflags*' '} #{BREWKIT_SAFE_FLAGS}"
# compile faster
ENV['MAKEFLAGS']="-j#{Hardware.processor_count}"
# /usr/local is always in the build system path
unless HOMEBREW_PREFIX.to_s == '/usr/local'
ENV['CPPFLAGS']="-I#{HOMEBREW_PREFIX}/include"
ENV['LDFLAGS']="-L#{HOMEBREW_PREFIX}/lib"
end
# you can use these functions for packages that have build issues
module HomebrewEnvExtension

View File

@ -28,7 +28,7 @@ class AbstractDownloadStrategy
end
end
class HttpDownloadStrategy <AbstractDownloadStrategy
class CurlDownloadStrategy <AbstractDownloadStrategy
def fetch
ohai "Downloading #{@url}"
if @unique_token
@ -93,6 +93,15 @@ private
end
end
class HttpDownloadStrategy <CurlDownloadStrategy
def initialize url, name, version
opoo "HttpDownloadStrategy is deprecated"
puts "Please use CurlDownloadStrategy in future"
puts "HttpDownloadStrategy will be removed in version 0.5"
super url, name, version
end
end
class SubversionDownloadStrategy <AbstractDownloadStrategy
def fetch
ohai "Checking out #{@url}"

View File

@ -110,7 +110,7 @@ class Formula
when %r[^http://(.+?\.)?googlecode\.com/svn] then SubversionDownloadStrategy
when %r[^http://(.+?\.)?sourceforge\.net/svnroot/] then SubversionDownloadStrategy
when %r[^http://svn.apache.org/repos/] then SubversionDownloadStrategy
else HttpDownloadStrategy
else CurlDownloadStrategy
end
end