aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/os
diff options
context:
space:
mode:
authorMarkus Reiter2016-09-23 22:02:23 +0200
committerMarkus Reiter2016-09-24 12:24:35 +0200
commit58e36c73193befb57d351344cea2a4a33fef850d (patch)
tree3d26751835440341e5a42a189cf580e6253785df /Library/Homebrew/extend/os
parentbbc3f1c3a852e6cfd26a7a7c333092fae0520eb4 (diff)
downloadbrew-58e36c73193befb57d351344cea2a4a33fef850d.tar.bz2
Fix Style/GuardClause.
Diffstat (limited to 'Library/Homebrew/extend/os')
-rw-r--r--Library/Homebrew/extend/os/mac/extend/ENV/std.rb63
-rw-r--r--Library/Homebrew/extend/os/mac/formula_cellar_checks.rb13
-rw-r--r--Library/Homebrew/extend/os/mac/utils/bottles.rb7
3 files changed, 39 insertions, 44 deletions
diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb
index 8efbd3bc9..4853ecf0c 100644
--- a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb
+++ b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb
@@ -20,14 +20,13 @@ module Stdenv
# Leopard's ld needs some convincing that it's building 64-bit
# See: https://github.com/mistydemeo/tigerbrew/issues/59
- if MacOS.version == :leopard && MacOS.prefer_64_bit?
- append "LDFLAGS", "-arch #{Hardware::CPU.arch_64_bit}"
+ return unless MacOS.version == :leopard && MacOS.prefer_64_bit?
+ append "LDFLAGS", "-arch #{Hardware::CPU.arch_64_bit}"
- # Many, many builds are broken thanks to Leopard's buggy ld.
- # Our ld64 fixes many of those builds, though of course we can't
- # depend on it already being installed to build itself.
- ld64 if Formula["ld64"].installed?
- end
+ # Many, many builds are broken thanks to Leopard's buggy ld.
+ # Our ld64 fixes many of those builds, though of course we can't
+ # depend on it already being installed to build itself.
+ ld64 if Formula["ld64"].installed?
end
def homebrew_extra_pkg_config_paths
@@ -65,19 +64,18 @@ module Stdenv
delete("CPATH")
remove "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib"
- if (sdk = MacOS.sdk_path(version)) && !MacOS::CLT.installed?
- delete("SDKROOT")
- remove_from_cflags "-isysroot #{sdk}"
- remove "CPPFLAGS", "-isysroot #{sdk}"
- remove "LDFLAGS", "-isysroot #{sdk}"
- if HOMEBREW_PREFIX.to_s == "/usr/local"
- delete("CMAKE_PREFIX_PATH")
- else
- # It was set in setup_build_environment, so we have to restore it here.
- self["CMAKE_PREFIX_PATH"] = HOMEBREW_PREFIX.to_s
- end
- remove "CMAKE_FRAMEWORK_PATH", "#{sdk}/System/Library/Frameworks"
+ return unless (sdk = MacOS.sdk_path(version)) && !MacOS::CLT.installed?
+ delete("SDKROOT")
+ remove_from_cflags "-isysroot #{sdk}"
+ remove "CPPFLAGS", "-isysroot #{sdk}"
+ remove "LDFLAGS", "-isysroot #{sdk}"
+ if HOMEBREW_PREFIX.to_s == "/usr/local"
+ delete("CMAKE_PREFIX_PATH")
+ else
+ # It was set in setup_build_environment, so we have to restore it here.
+ self["CMAKE_PREFIX_PATH"] = HOMEBREW_PREFIX.to_s
end
+ remove "CMAKE_FRAMEWORK_PATH", "#{sdk}/System/Library/Frameworks"
end
def macosxsdk(version = MacOS.version)
@@ -89,20 +87,19 @@ module Stdenv
self["CPATH"] = "#{HOMEBREW_PREFIX}/include"
prepend "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib"
- if (sdk = MacOS.sdk_path(version)) && !MacOS::CLT.installed?
- # Extra setup to support Xcode 4.3+ without CLT.
- self["SDKROOT"] = sdk
- # Tell clang/gcc where system include's are:
- append_path "CPATH", "#{sdk}/usr/include"
- # The -isysroot is needed, too, because of the Frameworks
- append_to_cflags "-isysroot #{sdk}"
- append "CPPFLAGS", "-isysroot #{sdk}"
- # And the linker needs to find sdk/usr/lib
- append "LDFLAGS", "-isysroot #{sdk}"
- # Needed to build cmake itself and perhaps some cmake projects:
- append_path "CMAKE_PREFIX_PATH", "#{sdk}/usr"
- append_path "CMAKE_FRAMEWORK_PATH", "#{sdk}/System/Library/Frameworks"
- end
+ return unless (sdk = MacOS.sdk_path(version)) && !MacOS::CLT.installed?
+ # Extra setup to support Xcode 4.3+ without CLT.
+ self["SDKROOT"] = sdk
+ # Tell clang/gcc where system include's are:
+ append_path "CPATH", "#{sdk}/usr/include"
+ # The -isysroot is needed, too, because of the Frameworks
+ append_to_cflags "-isysroot #{sdk}"
+ append "CPPFLAGS", "-isysroot #{sdk}"
+ # And the linker needs to find sdk/usr/lib
+ append "LDFLAGS", "-isysroot #{sdk}"
+ # Needed to build cmake itself and perhaps some cmake projects:
+ append_path "CMAKE_PREFIX_PATH", "#{sdk}/usr"
+ append_path "CMAKE_FRAMEWORK_PATH", "#{sdk}/System/Library/Frameworks"
end
# Some configure scripts won't find libxml2 without help
diff --git a/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb b/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb
index b3f8250ee..8bc42ad35 100644
--- a/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb
+++ b/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb
@@ -64,13 +64,12 @@ module FormulaCellarChecks
keg = Keg.new(formula.prefix)
checker = LinkageChecker.new(keg, formula)
- if checker.broken_dylibs?
- audit_check_output <<-EOS.undent
- The installation was broken.
- Broken dylib links found:
- #{checker.broken_dylibs.to_a * "\n "}
- EOS
- end
+ return unless checker.broken_dylibs?
+ audit_check_output <<-EOS.undent
+ The installation was broken.
+ Broken dylib links found:
+ #{checker.broken_dylibs.to_a * "\n "}
+ EOS
end
def audit_installed
diff --git a/Library/Homebrew/extend/os/mac/utils/bottles.rb b/Library/Homebrew/extend/os/mac/utils/bottles.rb
index accfc6a59..0dd7341ea 100644
--- a/Library/Homebrew/extend/os/mac/utils/bottles.rb
+++ b/Library/Homebrew/extend/os/mac/utils/bottles.rb
@@ -31,10 +31,9 @@ module Utils
# sometimes a formula has just :tiger_altivec, other times it has
# :tiger_g4, :tiger_g5, etc.
def find_altivec_tag(tag)
- if tag.to_s =~ /(\w+)_(g4|g4e|g5)$/
- altivec_tag = "#{$1}_altivec".to_sym
- altivec_tag if key?(altivec_tag)
- end
+ return unless tag.to_s =~ /(\w+)_(g4|g4e|g5)$/
+ altivec_tag = "#{$1}_altivec".to_sym
+ altivec_tag if key?(altivec_tag)
end
# Allows a bottle tag to specify a specific OS or later,