Skip to content

Commit

Permalink
Merge pull request Homebrew#1506 from MikeMcQuaid/audit-fix-version-n…
Browse files Browse the repository at this point in the history
…ot-decrease-again

audit: fix "version should not decrease" (again).
  • Loading branch information
MikeMcQuaid committed Nov 15, 2016
2 parents 484e3e0 + 5e0b3d2 commit c1af8fb
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Library/Homebrew/dev-cmd/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,10 @@ def audit_revision_and_version_scheme
attributes_for_version = spec_attribute_map[formula.version]
next if attributes_for_version.nil? || attributes_for_version.empty?

if formula.send(attribute) < attributes_for_version.max
problem "#{spec} #{attribute} should not decrease"
old_attribute = formula.send(attribute)
max_attribute = attributes_for_version.max
if max_attribute && old_attribute < max_attribute
problem "#{spec} #{attribute} should not decrease (from #{max_attribute} to #{old_attribute})"
end
end

Expand All @@ -687,8 +689,11 @@ def audit_revision_and_version_scheme
version_scheme.first == max_version_scheme
end.keys.max

if max_version && formula.version < max_version
problem "#{spec} version should not decrease"
formula_spec = formula.send(spec)
next if formula_spec.nil?

if max_version && formula_spec.version < max_version
problem "#{spec} version should not decrease (from #{max_version} to #{formula_spec.version})"
end
end

Expand Down

0 comments on commit c1af8fb

Please sign in to comment.