aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2016-11-15 12:36:06 +0000
committerGitHub2016-11-15 12:36:06 +0000
commitc1af8fba55dc2bdee54c41cb1e0dfe327ddf1084 (patch)
treed3f924d92d8a0e7e94f5dacbc4590418f33548ae /Library
parent484e3e0769d9eee760f46afb67fb2ce1bfe6e33d (diff)
parent5e0b3d24e5f2a59bf715e34e8c0a62c1307d474d (diff)
downloadbrew-c1af8fba55dc2bdee54c41cb1e0dfe327ddf1084.tar.bz2
Merge pull request #1506 from MikeMcQuaid/audit-fix-version-not-decrease-again
audit: fix "version should not decrease" (again).
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 9024cf50c..6c21c25de 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -674,8 +674,10 @@ class FormulaAuditor
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
@@ -687,8 +689,11 @@ class FormulaAuditor
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