From 7498cfff996c3eacdff0637614aaf59965b02cdf Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 20 Apr 2014 19:54:32 -0500 Subject: [PATCH] Remove to_flags monkeypatch --- Library/ENV/4.3/cc | 8 ++++++-- Library/ENV/libsuperenv.rb | 6 ------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index d05e81074f..9c1eeb23e8 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -232,7 +232,7 @@ class Cmd syslibpath end def ldflags - args = libpath.to_flags('-L') + args = path_flags("-L", libpath) case mode when :ld then args << '-headerpad_max_install_names' when :ccld then args << '-Wl,-headerpad_max_install_names' @@ -247,7 +247,7 @@ class Cmd sys, opt = cpath # we want our keg-only includes to be found before system includes *and* # before any other includes the build-system adds - sys.to_flags('-isystem') + opt.to_flags('-I') + path_flags("-isystem", sys) + path_flags("-I", opt) end def make_fuss args return unless make_fuss? @@ -278,6 +278,10 @@ class Cmd path = path.realpath if path.exist? path.to_s end + def path_flags(prefix, paths) + paths = paths.uniq.select { |path| File.directory?(path) } + paths.map! { |path| prefix + path } + end end if __FILE__ == $PROGRAM_NAME diff --git a/Library/ENV/libsuperenv.rb b/Library/ENV/libsuperenv.rb index c6b8c1c4b9..1b4ffa19db 100644 --- a/Library/ENV/libsuperenv.rb +++ b/Library/ENV/libsuperenv.rb @@ -13,9 +13,3 @@ class NilClass def chuzzle; end def split(x); [] end end - -class Array - def to_flags prefix - select { |path| File.directory? path }.uniq.map { |path| prefix + path } - end -end