blacklist: port to generic layer.
This commit is contained in:
parent
c186d39289
commit
c86c600bfd
@ -28,16 +28,6 @@ def blacklisted?(name)
|
||||
EOS
|
||||
when /(lib)?lzma/
|
||||
"lzma is now part of the xz formula."
|
||||
when "xcode"
|
||||
if MacOS.version >= :lion
|
||||
<<-EOS.undent
|
||||
Xcode can be installed from the App Store.
|
||||
EOS
|
||||
else
|
||||
<<-EOS.undent
|
||||
Xcode can be installed from https://developer.apple.com/xcode/downloads/
|
||||
EOS
|
||||
end
|
||||
when "gtest", "googletest", "google-test" then <<-EOS.undent
|
||||
Installing gtest system-wide is not recommended; it should be vendored
|
||||
in your projects that use it.
|
||||
@ -97,3 +87,6 @@ def blacklisted?(name)
|
||||
EOS
|
||||
end
|
||||
end
|
||||
alias generic_blacklisted? blacklisted?
|
||||
|
||||
require "extend/os/blacklist"
|
||||
|
5
Library/Homebrew/extend/os/blacklist.rb
Normal file
5
Library/Homebrew/extend/os/blacklist.rb
Normal file
@ -0,0 +1,5 @@
|
||||
require "blacklist"
|
||||
|
||||
if OS.mac?
|
||||
require "extend/os/mac/blacklist"
|
||||
end
|
16
Library/Homebrew/extend/os/mac/blacklist.rb
Normal file
16
Library/Homebrew/extend/os/mac/blacklist.rb
Normal file
@ -0,0 +1,16 @@
|
||||
def blacklisted?(name)
|
||||
case name.downcase
|
||||
when "xcode"
|
||||
if MacOS.version >= :lion
|
||||
<<-EOS.undent
|
||||
Xcode can be installed from the App Store.
|
||||
EOS
|
||||
else
|
||||
<<-EOS.undent
|
||||
Xcode can be installed from https://developer.apple.com/xcode/downloads/
|
||||
EOS
|
||||
end
|
||||
else
|
||||
generic_blacklisted?(name)
|
||||
end
|
||||
end
|
@ -30,10 +30,6 @@ class BlacklistTests < Homebrew::TestCase
|
||||
%w[lzma liblzma].each { |s| assert_blacklisted s }
|
||||
end
|
||||
|
||||
def test_xcode
|
||||
%w[xcode Xcode].each { |s| assert_blacklisted s }
|
||||
end
|
||||
|
||||
def test_gtest
|
||||
%w[gtest googletest google-test].each { |s| assert_blacklisted s }
|
||||
end
|
||||
|
12
Library/Homebrew/test/test_os_mac_blacklist.rb
Normal file
12
Library/Homebrew/test/test_os_mac_blacklist.rb
Normal file
@ -0,0 +1,12 @@
|
||||
require "testing_env"
|
||||
require "blacklist"
|
||||
|
||||
class BlacklistTests < Homebrew::TestCase
|
||||
def assert_blacklisted(s)
|
||||
assert blacklisted?(s), "'#{s}' should be blacklisted"
|
||||
end
|
||||
|
||||
def test_xcode
|
||||
%w[xcode Xcode].each { |s| assert_blacklisted s }
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user