Deprecate MacOS.version? style methods
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
		
							parent
							
								
									b8231fc5f3
								
							
						
					
					
						commit
						166a9ba0ed
					
				@ -796,7 +796,7 @@ def check_git_status
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
def check_for_leopard_ssl
 | 
			
		||||
  if MacOS.leopard? and not ENV['GIT_SSL_NO_VERIFY']
 | 
			
		||||
  if MacOS.version == :leopard and not ENV['GIT_SSL_NO_VERIFY']
 | 
			
		||||
    <<-EOS.undent
 | 
			
		||||
      The version of libcurl provided with Mac OS X Leopard has outdated
 | 
			
		||||
      SSL certificates.
 | 
			
		||||
 | 
			
		||||
@ -197,4 +197,23 @@ module MacOS extend self
 | 
			
		||||
  def x11_prefix
 | 
			
		||||
    X11.prefix
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def leopard?
 | 
			
		||||
    10.5 == MACOS_VERSION
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def snow_leopard?
 | 
			
		||||
    10.6 <= MACOS_VERSION # Actually Snow Leopard or newer
 | 
			
		||||
  end
 | 
			
		||||
  alias_method :snow_leopard_or_newer?, :snow_leopard?
 | 
			
		||||
 | 
			
		||||
  def lion?
 | 
			
		||||
    10.7 <= MACOS_VERSION # Actually Lion or newer
 | 
			
		||||
  end
 | 
			
		||||
  alias_method :lion_or_newer?, :lion?
 | 
			
		||||
 | 
			
		||||
  def mountain_lion?
 | 
			
		||||
    10.8 <= MACOS_VERSION # Actually Mountain Lion or newer
 | 
			
		||||
  end
 | 
			
		||||
  alias_method :mountain_lion_or_newer?, :mountain_lion?
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@ -63,7 +63,7 @@ private
 | 
			
		||||
      # Xcode no longer provides autotools or some other build tools
 | 
			
		||||
      Dependency.new(spec.to_s) unless MacOS::Xcode.provides_autotools?
 | 
			
		||||
    when :libpng, :freetype, :pixman, :fontconfig, :cairo
 | 
			
		||||
      if MacOS.lion_or_newer?
 | 
			
		||||
      if MacOS.version >= :lion
 | 
			
		||||
        MacOS::XQuartz.installed? ? X11Dependency.new(tag) : Dependency.new(spec.to_s)
 | 
			
		||||
      else
 | 
			
		||||
        X11Dependency.new(tag)
 | 
			
		||||
 | 
			
		||||
@ -261,7 +261,7 @@ class SubversionDownloadStrategy < AbstractDownloadStrategy
 | 
			
		||||
    svncommand = target.exist? ? 'up' : 'checkout'
 | 
			
		||||
    args = [svn, svncommand]
 | 
			
		||||
    # SVN shipped with XCode 3.1.4 can't force a checkout.
 | 
			
		||||
    args << '--force' unless MacOS.leopard? and svn == '/usr/bin/svn'
 | 
			
		||||
    args << '--force' unless MacOS.version == :leopard and svn == '/usr/bin/svn'
 | 
			
		||||
    args << url if !target.exist?
 | 
			
		||||
    args << target
 | 
			
		||||
    args << '-r' << revision if revision
 | 
			
		||||
 | 
			
		||||
@ -9,7 +9,7 @@ module HomebrewEnvExtension
 | 
			
		||||
    delete('CLICOLOR_FORCE') # autotools doesn't like this
 | 
			
		||||
    remove_cc_etc
 | 
			
		||||
 | 
			
		||||
    if MacOS.mountain_lion?
 | 
			
		||||
    if MacOS.version >= :mountain_lion
 | 
			
		||||
      # Fix issue with sed barfing on unicode characters on Mountain Lion.
 | 
			
		||||
      delete('LC_ALL')
 | 
			
		||||
      self['LC_CTYPE']="C"
 | 
			
		||||
 | 
			
		||||
@ -8,16 +8,11 @@ module MacOS extend self
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def cat
 | 
			
		||||
    if mountain_lion?
 | 
			
		||||
      :mountainlion
 | 
			
		||||
    elsif lion?
 | 
			
		||||
      :lion
 | 
			
		||||
    elsif snow_leopard?
 | 
			
		||||
      :snowleopard
 | 
			
		||||
    elsif leopard?
 | 
			
		||||
      :leopard
 | 
			
		||||
    else
 | 
			
		||||
      nil
 | 
			
		||||
    if version == :mountain_lion then :mountainlion
 | 
			
		||||
    elsif version == :lion then :lion
 | 
			
		||||
    elsif version == :snow_leopard then :snowleopard
 | 
			
		||||
    elsif version == :leopard then :leopard
 | 
			
		||||
    else nil
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
@ -200,27 +195,8 @@ module MacOS extend self
 | 
			
		||||
    false
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def leopard?
 | 
			
		||||
    10.5 == MACOS_VERSION
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def snow_leopard?
 | 
			
		||||
    10.6 <= MACOS_VERSION # Actually Snow Leopard or newer
 | 
			
		||||
  end
 | 
			
		||||
  alias :snow_leopard_or_newer? :snow_leopard?
 | 
			
		||||
 | 
			
		||||
  def lion?
 | 
			
		||||
    10.7 <= MACOS_VERSION # Actually Lion or newer
 | 
			
		||||
  end
 | 
			
		||||
  alias :lion_or_newer? :lion?
 | 
			
		||||
 | 
			
		||||
  def mountain_lion?
 | 
			
		||||
    10.8 <= MACOS_VERSION # Actually Mountain Lion or newer
 | 
			
		||||
  end
 | 
			
		||||
  alias :mountain_lion_or_newer? :mountain_lion?
 | 
			
		||||
 | 
			
		||||
  def prefer_64_bit?
 | 
			
		||||
    Hardware.is_64_bit? and not leopard?
 | 
			
		||||
    Hardware.is_64_bit? and version != :leopard
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  StandardCompilers = {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user