From 77611bafb1dfc68e9cd59fb21163aefa53fccf2c Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 4 Apr 2016 11:46:33 +0100 Subject: Make Homebrew user agent consistent, use a slash. Generally it seems user agents are all `software/version` but ours is not. Also, set the user agent in a way that it's shared between Bash and Ruby code. Closes https://github.com/Homebrew/legacy-homebrew/pull/50480. --- Library/Homebrew/utils.rb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'Library/Homebrew/utils.rb') diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 509a5ff20..f5fb738e7 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -309,18 +309,13 @@ def quiet_system(cmd, *args) end def curl(*args) - brewed_curl = HOMEBREW_PREFIX/"opt/curl/bin/curl" - curl = if MacOS.version <= "10.8" && brewed_curl.exist? - brewed_curl - else - Pathname.new "/usr/bin/curl" - end + curl = Pathname.new ENV["HOMEBREW_CURL"] raise "#{curl} is not executable" unless curl.exist? && curl.executable? flags = HOMEBREW_CURL_ARGS flags = flags.delete("#") if ARGV.verbose? - args = [flags, HOMEBREW_USER_AGENT, *args] + args = [flags, HOMEBREW_USER_AGENT_CURL, *args] args << "--verbose" if ENV["HOMEBREW_CURL_VERBOSE"] args << "--silent" if !$stdout.tty? || ENV["TRAVIS"] @@ -594,7 +589,7 @@ module GitHub def api_headers { - "User-Agent" => HOMEBREW_USER_AGENT, + "User-Agent" => HOMEBREW_USER_AGENT_RUBY, "Accept" => "application/vnd.github.v3+json" } end -- cgit v1.2.3