diff options
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 10 | ||||
| -rw-r--r-- | Library/Homebrew/os/mac.rb | 6 | ||||
| -rw-r--r-- | Library/Homebrew/os/mac/xcode.rb | 2 | 
3 files changed, 6 insertions, 12 deletions
| diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index bc31babd9..65d47c161 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -436,17 +436,11 @@ class SubversionDownloadStrategy < VCSDownloadStrategy    private    def repo_url -    `svn info '#{cached_location}' 2>/dev/null`.strip[/^URL: (.+)$/, 1] -  end - -  def shell_quote str -    # Oh god escaping shell args. -    # See http://notetoself.vrensk.com/2008/08/escaping-single-quotes-in-ruby-harder-than-expected/ -    str.gsub(/\\|'/) { |c| "\\#{c}" } +    Utils.popen_read("svn", "info", cached_location.to_s).strip[/^URL: (.+)$/, 1]    end    def get_externals -    `svn propget svn:externals '#{shell_quote(@url)}'`.chomp.each_line do |line| +    Utils.popen_read("svn", "propget", "svn:externals", @url).chomp.each_line do |line|        name, url = line.split(/\s+/)        yield name, url      end diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index e1f838862..29fcbe958 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -30,21 +30,21 @@ module OS          elsif File.executable?(path = "#{HOMEBREW_PREFIX}/bin/#{tool}")            Pathname.new path          else -          path = `/usr/bin/xcrun -no-cache -find #{tool} 2>/dev/null`.chomp +          path = Utils.popen_read("/usr/bin/xcrun", "-no-cache", "-find", tool).chomp            Pathname.new(path) if File.executable?(path)          end        end      end      def active_developer_dir -      @active_developer_dir ||= `xcode-select -print-path 2>/dev/null`.strip +      @active_developer_dir ||= Utils.popen_read("/usr/bin/xcode-select", "-print-path").strip      end      def sdk_path(v = version)        (@sdk_path ||= {}).fetch(v.to_s) do |key|          opts = []          # First query Xcode itself -        opts << `#{locate('xcodebuild')} -version -sdk macosx#{v} Path 2>/dev/null`.chomp +        opts << Utils.popen_read(locate("xcodebuild"), "-version", "-sdk", "macosx#{v}", "Path").chomp          # Xcode.prefix is pretty smart, so lets look inside to find the sdk          opts << "#{Xcode.prefix}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX#{v}.sdk"          # Xcode < 4.3 style diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index c4e53504f..5d5e02d9a 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -77,7 +77,7 @@ module OS          %W[#{prefix}/usr/bin/xcodebuild #{which("xcodebuild")}].uniq.each do |path|            if File.file? path -            `#{path} -version 2>/dev/null` =~ /Xcode (\d(\.\d)*)/ +            Utils.popen_read(path, "-version") =~ /Xcode (\d(\.\d)*)/              return $1 if $1            end          end | 
