diff options
| author | Mike McQuaid | 2016-09-24 20:48:03 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2016-09-24 20:48:03 +0100 |
| commit | e767fd3df9d179fca0445cc0bc0fdc061ad857d6 (patch) | |
| tree | 93e9db33313b36eebe7d7fb3aedf0f92cc2c3918 /Library/Homebrew/dev-cmd/pull.rb | |
| parent | 7fc241765e3654718235791c32e5638bf7f8e15a (diff) | |
| parent | 232078df57418004bb9bf7abef877e734fcf7005 (diff) | |
| download | brew-e767fd3df9d179fca0445cc0bc0fdc061ad857d6.tar.bz2 | |
Merge branch 'master' into mkdir_with_intermediates
Diffstat (limited to 'Library/Homebrew/dev-cmd/pull.rb')
| -rw-r--r-- | Library/Homebrew/dev-cmd/pull.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb index 7f027e159..857c55993 100644 --- a/Library/Homebrew/dev-cmd/pull.rb +++ b/Library/Homebrew/dev-cmd/pull.rb @@ -41,12 +41,12 @@ require "pkg_version" module Homebrew def pull - if ARGV[0] == "--rebase" - odie "You meant `git pull --rebase`." - end + odie "You meant `git pull --rebase`." if ARGV[0] == "--rebase" + if ARGV.named.empty? odie "This command requires at least one argument containing a URL or pull request number" end + do_bump = ARGV.include?("--bump") && !ARGV.include?("--clean") # Formulae with affected bottles that were published @@ -429,9 +429,9 @@ module Homebrew # Returns nil if formula is absent or if there was an error reading it def self.lookup(name) json = Utils.popen_read(HOMEBREW_BREW_FILE, "info", "--json=v1", name) - unless $?.success? - return nil - end + + return nil unless $?.success? + Homebrew.force_utf8!(json) FormulaInfoFromJson.new(Utils::JSON.load(json)[0]) end @@ -531,19 +531,19 @@ module Homebrew req = Net::HTTP::Head.new bottle_info.url req.initialize_http_header "User-Agent" => HOMEBREW_USER_AGENT_RUBY res = http.request req - if res.is_a?(Net::HTTPSuccess) - break - elsif res.is_a?(Net::HTTPClientError) - if retry_count >= max_retries - raise "Failed to find published #{f} bottle at #{url}!" - end - print(wrote_dots ? "." : "Waiting on Bintray.") - wrote_dots = true - sleep poll_retry_delay_seconds - retry_count += 1 - else + break if res.is_a?(Net::HTTPSuccess) + + unless res.is_a?(Net::HTTPClientError) raise "Failed to find published #{f} bottle at #{url} (#{res.code} #{res.message})!" end + + if retry_count >= max_retries + raise "Failed to find published #{f} bottle at #{url}!" + end + print(wrote_dots ? "." : "Waiting on Bintray.") + wrote_dots = true + sleep poll_retry_delay_seconds + retry_count += 1 end end |
