diff options
| author | Adam Vandenberg | 2011-06-16 20:15:38 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2011-06-16 20:31:55 -0700 |
| commit | 4c00eb6dcde091a217294176f1e2f04275d505ed (patch) | |
| tree | c7bff8db083dc3945fb25c512297e5870055e17e | |
| parent | cb1ab232e922f6206dec140a663bac151bddfec7 (diff) | |
| download | homebrew-4c00eb6dcde091a217294176f1e2f04275d505ed.tar.bz2 | |
audit: check for redundant 'version'
| -rwxr-xr-x | Library/Homebrew/cmd/audit.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index cb3bdcc5c..d267c2ba3 100755 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -155,6 +155,19 @@ def audit_formula_options f, text return problems end +def audit_formula_version f, text + # Version as defined in the DSL (or nil) + version_text = f.class.send('version').to_s + # Version as determined from the URL + version_url = Pathname.new(f.url).version + + if version_url == version_text + return [" * version "+version_text+" is redundant with version scanned from url"] + end + + return [] +end + def audit_formula_urls f problems = [] @@ -281,6 +294,7 @@ module Homebrew extend self problems += audit_formula_text(f.name, text_without_patch) problems += audit_formula_options(f, text_without_patch) + problems += audit_formula_version(f, text_without_patch) unless problems.empty? errors = true |
