mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Merge pull request #5168 from commitay/we-add-the-bottle-block
audit: check for `bottle do` blocks in new formulae
This commit is contained in:
commit
a4c62d37b1
@ -254,6 +254,7 @@ module Homebrew
|
|||||||
def initialize(formula, options = {})
|
def initialize(formula, options = {})
|
||||||
@formula = formula
|
@formula = formula
|
||||||
@versioned_formula = formula.versioned_formula?
|
@versioned_formula = formula.versioned_formula?
|
||||||
|
@new_formula_inclusive = options[:new_formula]
|
||||||
@new_formula = options[:new_formula] && !@versioned_formula
|
@new_formula = options[:new_formula] && !@versioned_formula
|
||||||
@strict = options[:strict]
|
@strict = options[:strict]
|
||||||
@online = options[:online]
|
@online = options[:online]
|
||||||
@ -563,6 +564,18 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def audit_bottle_spec
|
||||||
|
# special case: new versioned formulae should be audited
|
||||||
|
return unless @new_formula_inclusive
|
||||||
|
return unless @core_tap
|
||||||
|
|
||||||
|
return if formula.bottle_disabled?
|
||||||
|
|
||||||
|
return unless formula.bottle_defined?
|
||||||
|
|
||||||
|
new_formula_problem "New formulae should not have a `bottle do` block"
|
||||||
|
end
|
||||||
|
|
||||||
def audit_bottle_disabled
|
def audit_bottle_disabled
|
||||||
return unless formula.bottle_disabled?
|
return unless formula.bottle_disabled?
|
||||||
return if formula.bottle_unneeded?
|
return if formula.bottle_unneeded?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user