Skip to content
Snippets Groups Projects
Unverified Commit f7d0c89c authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #4348 from errordeveloper/master

Ignore any version of Go, when it is a dependency of a bottle
parents 60e6b511 5e6c40e2
No related branches found
No related tags found
No related merge requests found
......@@ -284,8 +284,13 @@ module Homebrew
end
ignores = []
if f.deps.any? { |dep| dep.name == "go" }
ignores << %r{#{Regexp.escape(HOMEBREW_CELLAR)}/go/[\d\.]+/libexec}
any_go_deps = f.deps.any? do |dep|
dep.name =~ Version.formula_optionally_versioned_regex(:go)
end
if any_go_deps
go_regex =
Version.formula_optionally_versioned_regex(:go, full: false)
ignores << %r{#{Regexp.escape(HOMEBREW_CELLAR)}/#{go_regex}/[\d\.]+/libexec}
end
relocatable = true
......
......@@ -7,7 +7,7 @@ module FormulaCellarChecks
formula.name.start_with?(formula_name)
end
return if formula.name =~ /^php(@?\d+\.?\d*?)?$/
return if formula.name =~ Version.formula_optionally_versioned_regex(:php)
return if MacOS.version < :mavericks && formula.name.start_with?("postgresql")
return if MacOS.version < :yosemite && formula.name.start_with?("memcached")
......
......@@ -290,7 +290,7 @@ module RuboCop
find_every_method_call_by_name(body_node, :system).each do |method_node|
# Skip Kibana: npm cache edge (see formula for more details)
next if @formula_name =~ /^kibana(\@\d+(\.\d+)?)?$/i
next if @formula_name =~ /^kibana(@\d[\d.]*)?$/
first_param, second_param = parameters(method_node)
next if !node_equals?(first_param, "npm") ||
!node_equals?(second_param, "install")
......
require "version"
describe Version do
specify ".formula_optionally_versioned_regex" do
expect(described_class.formula_optionally_versioned_regex("foo")).to match("foo@1.2")
end
end
describe Version::Token do
specify "#inspect" do
expect(described_class.new("foo").inspect).to eq('#<Version::Token "foo">')
......
......@@ -3,6 +3,10 @@ require "version/null"
class Version
include Comparable
def self.formula_optionally_versioned_regex(name, full: true)
/#{"^" if full}#{Regexp.escape(name)}(@\d[\d.]*)?#{"$" if full}/
end
class Token
include Comparable
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment