aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-02-15 17:47:24 -0500
committerJack Nagel2014-02-15 17:47:24 -0500
commitcf44bb010b24b5f85a9554d2215505d6775a5520 (patch)
tree1c3afb9b21c564d106ad094e6a0f36c2d1ca84d6 /Library
parent8393d86ddb109b2472d22b9c4c30d8b8008c3f63 (diff)
downloadhomebrew-cf44bb010b24b5f85a9554d2215505d6775a5520.tar.bz2
Formula#system: simplify xcodebuild special case
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index b1fe8e9ec..3792e0a7b 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -552,6 +552,8 @@ class Formula
# Pretty titles the command and buffers stdout/stderr
# Throws if there's an error
def system cmd, *args
+ removed_ENV_variables = {}
+
# remove "boring" arguments so that the important ones are more likely to
# be shown considering that we trim long ohai lines to the terminal width
pretty_args = args.dup
@@ -561,9 +563,8 @@ class Formula
end
ohai "#{cmd} #{pretty_args*' '}".strip
- removed_ENV_variables = case if args.empty? then cmd.split(' ').first else cmd end
- when "xcodebuild"
- ENV.remove_cc_etc
+ if cmd.to_s.start_with? "xcodebuild"
+ removed_ENV_variables.update(ENV.remove_cc_etc)
end
@exec_count ||= 0
@@ -606,7 +607,7 @@ class Formula
end
ensure
rd.close if rd and not rd.closed?
- ENV.update(removed_ENV_variables) if removed_ENV_variables
+ ENV.update(removed_ENV_variables)
end
private