Don't run certain functions on non-MACOS.

This commit is contained in:
Mike McQuaid 2013-03-10 17:03:40 +00:00
parent 9837bbda55
commit 98352b3b41
3 changed files with 3 additions and 0 deletions

View File

@ -201,6 +201,7 @@ module HomebrewEnvExtension
end end
def macosxsdk v=MacOS.version def macosxsdk v=MacOS.version
return unless MACOS
# Sets all needed lib and include dirs to CFLAGS, CPPFLAGS, LDFLAGS. # Sets all needed lib and include dirs to CFLAGS, CPPFLAGS, LDFLAGS.
remove_macosxsdk remove_macosxsdk
# Allow cool style of ENV.macosxsdk 10.8 here (no "" :) # Allow cool style of ENV.macosxsdk 10.8 here (no "" :)

View File

@ -1,5 +1,6 @@
class Keg class Keg
def fix_install_names def fix_install_names
return unless MACOS
mach_o_files.each do |file| mach_o_files.each do |file|
bad_install_names_for file do |id, bad_names| bad_install_names_for file do |id, bad_names|
file.ensure_writable do file.ensure_writable do

View File

@ -227,6 +227,7 @@ module MacOS extend self
end end
def mdfind id def mdfind id
return [] unless MACOS
(@mdfind ||= {}).fetch(id.to_s) do (@mdfind ||= {}).fetch(id.to_s) do
@mdfind[id.to_s] = `/usr/bin/mdfind "kMDItemCFBundleIdentifier == '#{id}'"`.split("\n") @mdfind[id.to_s] = `/usr/bin/mdfind "kMDItemCFBundleIdentifier == '#{id}'"`.split("\n")
end end