From 986a62ebe97666209f7726c57417a071202b0268 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Wed, 17 Jun 2015 04:58:32 +0100 Subject: [PATCH] audit: flag re-added tap migrations Re https://github.com/Homebrew/homebrew/commit/411c2178448916d4005c059bc35ee780b5af53f5#commitcomment-11714539 Closes Homebrew/homebrew#40806. Signed-off-by: Dominyk Tiller --- Library/Homebrew/cmd/audit.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 4851c07442..3a41dbdfa3 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -3,6 +3,7 @@ require "utils" require "extend/ENV" require "formula_cellar_checks" require "official_taps" +require "tap_migrations" require "cmd/search" module Homebrew @@ -769,6 +770,20 @@ class FormulaAuditor end end + def audit_reverse_migration + # Only enforce for new formula being re-added to core + return unless @strict + return unless formula.core_formula? + + if TAP_MIGRATIONS.has_key?(formula.name) + problem <<-EOS.undent + #{formula.name} seems to be listed in tap_migrations.rb! + Please remove #{formula.name} from present tap & tap_migrations.rb + before submitting it to Homebrew/homebrew. + EOS + end + end + def audit_prefix_has_contents return unless formula.prefix.directory? @@ -823,6 +838,7 @@ class FormulaAuditor text.without_patch.split("\n").each_with_index { |line, lineno| audit_line(line, lineno+1) } audit_installed audit_prefix_has_contents + audit_reverse_migration end private