diff options
| author | Adam Vandenberg | 2013-05-27 22:24:22 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2013-05-27 22:25:34 -0700 |
| commit | 903c340664a32ce37fef58de9719d4176f723301 (patch) | |
| tree | 1fe68999e94c92936f68d7a84dc03d701453913d /Library | |
| parent | 0e7d47332c31c93d431ee6b85b2255f7ca7bd1ce (diff) | |
| download | brew-903c340664a32ce37fef58de9719d4176f723301.tar.bz2 | |
Audit url/devel/head for redundant :using
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 10 | ||||
| -rw-r--r-- | Library/Homebrew/formula_support.rb | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index f4ed74ba6..6bab71095 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -294,6 +294,16 @@ class FormulaAuditor problem "#{cksum.hash_type} should be lowercase" unless cksum.hexdigest == cksum.hexdigest.downcase end end + + # Check for :using that is already detected from the url + @specs.each do |s| + next if s.using.nil? + + url_strategy = DownloadStrategyDetector.detect(s.url) + using_strategy = DownloadStrategyDetector.detect('', s.using) + + problem "redundant :using specification in url or head" if url_strategy == using_strategy + end end def audit_patches diff --git a/Library/Homebrew/formula_support.rb b/Library/Homebrew/formula_support.rb index ed8b72d9d..85f215ade 100644 --- a/Library/Homebrew/formula_support.rb +++ b/Library/Homebrew/formula_support.rb @@ -4,6 +4,7 @@ require 'version' class SoftwareSpec attr_reader :checksum, :mirrors, :specs + attr_reader :using # for auditing def initialize url=nil, version=nil @url = url |
