aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2012-08-27 08:48:02 -0400
committerMax Howell2012-08-29 12:41:35 -0400
commit4f06d131dfffc9de625697c2135262f624534a6e (patch)
tree990090b869764454cd30ebbe833e72f1e910ecf0
parent1ec368759ea3b2a1aa7484988d3494b3ba212c95 (diff)
downloadbrew-4f06d131dfffc9de625697c2135262f624534a6e.tar.bz2
Superenv wrapper for sed
Fixes Mountain Lion specific sed issue. Provided scripts don't use the full-path to see we are fine. They never do though, that would assume too much.
-rwxr-xr-xLibrary/ENV/4.3/sed7
-rw-r--r--Library/Homebrew/superenv.rb16
2 files changed, 16 insertions, 7 deletions
diff --git a/Library/ENV/4.3/sed b/Library/ENV/4.3/sed
new file mode 100755
index 000000000..420e39669
--- /dev/null
+++ b/Library/ENV/4.3/sed
@@ -0,0 +1,7 @@
+#!/bin/bash
+if [[ $HOMEBREW_CCCFG == *s* ]]; then
+ # Fix issue with sed barfing on unicode characters on Mountain Lion
+ unset LC_ALL
+ export LC_CTYPE='C'
+fi
+exec /usr/bin/sed "$@"
diff --git a/Library/Homebrew/superenv.rb b/Library/Homebrew/superenv.rb
index f9e8761bf..50ae6aa93 100644
--- a/Library/Homebrew/superenv.rb
+++ b/Library/Homebrew/superenv.rb
@@ -34,12 +34,6 @@ class << ENV
delete('CDPATH') # avoid make issues that depend on changing directories
delete('GREP_OPTIONS') # can break CMake
delete('CLICOLOR_FORCE') # autotools doesn't like this
-
- if MacOS.mountain_lion?
- # Fix issue with sed barfing on unicode characters on Mountain Lion
- delete('LC_ALL')
- ENV['LC_CTYPE'] = "C"
- end
end
def setup_build_environment
@@ -53,7 +47,7 @@ class << ENV
ENV['PATH'] = determine_path
ENV['PKG_CONFIG_PATH'] = determine_pkg_config_path
ENV['HOMEBREW_CC'] = determine_cc
- ENV['HOMEBREW_CCCFG'] = 'b' if ARGV.build_bottle?
+ ENV['HOMEBREW_CCCFG'] = determine_cccfg
ENV['HOMEBREW_SDKROOT'] = "#{MacOS.sdk_path}" if MacSystem.xcode43_without_clt?
ENV['CMAKE_PREFIX_PATH'] = determine_cmake_prefix_path
ENV['CMAKE_FRAMEWORK_PATH'] = "#{MacOS.sdk_path}/System/Library/Frameworks" if MacSystem.xcode43_without_clt?
@@ -155,6 +149,14 @@ class << ENV
end
end
+ def determine_cccfg
+ s = ""
+ # Fix issue with sed barfing on unicode characters on Mountain Lion
+ s << 's' if MacOS.mountain_lion?
+ s << 'b' if ARGV.build_bottle?
+ s
+ end
+
public
### NO LONGER NECESSARY OR NO LONGER SUPPORTED