aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorXu Cheng2016-01-15 16:17:14 +0800
committerXu Cheng2016-01-17 14:52:14 +0800
commitd4c7dedf1246e31daca2aa9be22f8f6e4a6c528f (patch)
tree87a28401c2773e68716c62a3ce9b65a16b20e01d /Library/Homebrew
parent176f345386b0f9d50d7bbc0e0879056dc00119ad (diff)
downloadbrew-d4c7dedf1246e31daca2aa9be22f8f6e4a6c528f.tar.bz2
audit: imporve revision check logic
* Check revision decrease against both stable and devel spec. * Check revision reset only for stable spec if stable spec is available.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/audit.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 8c700f42e..a5221fe37 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -588,8 +588,14 @@ class FormulaAuditor
revision_map = fv.revision_map("origin/master")
if (revisions = revision_map[formula.version]).any?
problem "revision should not decrease" if formula.revision < revisions.max
- else
- problem "revision should be removed" unless formula.revision == 0
+ elsif formula.revision != 0
+ if formula.stable
+ if revision_map[formula.stable.version].empty? # check stable spec
+ problem "revision should be removed"
+ end
+ else # head/devel-only formula
+ problem "revision should be removed"
+ end
end
end