diff options
| author | Jack Nagel | 2014-12-16 15:27:36 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2014-12-16 15:51:57 -0500 | 
| commit | a73ec7bd90624dc83f1f6b3bcee8eddb83d6a7b9 (patch) | |
| tree | 954cc277c28d986f39adb032db0a9b87067166c5 /Library/Homebrew/download_strategy.rb | |
| parent | 4b808be658a81e8312b95375fb75ebe3046da74e (diff) | |
| download | homebrew-a73ec7bd90624dc83f1f6b3bcee8eddb83d6a7b9.tar.bz2 | |
Use Utils.popen_read to avoid shelling out in a few places
Diffstat (limited to 'Library/Homebrew/download_strategy.rb')
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 10 | 
1 files changed, 2 insertions, 8 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 | 
