minor perf improvements
Closes Homebrew/homebrew#47224. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
This commit is contained in:
parent
d09698f19f
commit
48681c3f3a
@ -36,7 +36,8 @@ MAXIMUM_STRING_MATCHES = 100
|
||||
|
||||
module Homebrew
|
||||
def keg_contains(string, keg, ignores)
|
||||
@put_string_exists_header, @put_filenames = nil
|
||||
@put_string_exists_header = nil
|
||||
@put_filenames = nil
|
||||
|
||||
def print_filename(string, filename)
|
||||
unless @put_string_exists_header
|
||||
|
||||
@ -1298,13 +1298,14 @@ module Homebrew
|
||||
|
||||
first_warning = true
|
||||
methods.each do |method|
|
||||
begin
|
||||
out = checks.send(method)
|
||||
rescue NoMethodError
|
||||
unless checks.respond_to?(method)
|
||||
Homebrew.failed = true
|
||||
puts "No check available by the name: #{method}"
|
||||
next
|
||||
end
|
||||
|
||||
out = checks.send(method)
|
||||
|
||||
unless out.nil? || out.empty?
|
||||
if first_warning
|
||||
$stderr.puts <<-EOS.undent
|
||||
|
||||
@ -59,7 +59,7 @@ module Homebrew
|
||||
url = "https://github.com/Homebrew/homebrew/pull/#{arg}"
|
||||
tap = CoreFormulaRepository.instance
|
||||
elsif (testing_match = arg.match %r{brew.sh/job/Homebrew.*Testing/(\d+)/})
|
||||
_, testing_job = *testing_match
|
||||
testing_job = testing_match[1]
|
||||
url = "https://github.com/Homebrew/homebrew/compare/master...BrewTestBot:testing-#{testing_job}"
|
||||
tap = CoreFormulaRepository.instance
|
||||
odie "Testing URLs require `--bottle`!" unless ARGV.include?("--bottle")
|
||||
|
||||
@ -33,7 +33,7 @@ class CompilerFailure
|
||||
def self.create(spec, &block)
|
||||
# Non-Apple compilers are in the format fails_with compiler => version
|
||||
if spec.is_a?(Hash)
|
||||
_, major_version = spec.first
|
||||
major_version = spec.first[1]
|
||||
name = "gcc-#{major_version}"
|
||||
# so fails_with :gcc => '4.8' simply marks all 4.8 releases incompatible
|
||||
version = "#{major_version}.999"
|
||||
|
||||
@ -1271,7 +1271,7 @@ class Formula
|
||||
"root_url" => bottle_spec.root_url,
|
||||
}
|
||||
bottle_info["files"] = {}
|
||||
bottle_spec.collector.keys.each do |os|
|
||||
bottle_spec.collector.each_key do |os|
|
||||
checksum = bottle_spec.collector[os]
|
||||
bottle_info["files"][os] = {
|
||||
"url" => "#{bottle_spec.root_url}/#{Bottle::Filename.create(self, os, bottle_spec.revision)}",
|
||||
|
||||
@ -24,7 +24,8 @@ module Utils
|
||||
obj.inject({}) do |result, (key, val)|
|
||||
key = key.respond_to?(:to_s) ? key.to_s : key
|
||||
val = stringify_keys(val)
|
||||
result.merge!(key => val)
|
||||
result[key] = val
|
||||
result
|
||||
end
|
||||
else
|
||||
obj
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user