diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index faf9557e76..a9afe5ad7d 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -122,7 +122,7 @@ module Homebrew matches.map do |match| filename = File.basename(match["path"], ".rb") tap = Tap.fetch(match["repository"]["full_name"]) - next if tap.installed? && !(tap.user == "Homebrew" && tap.repo.start_with?("cask")) + next if tap.installed? && !tap.name.start_with?("homebrew/cask") "#{tap.name}/#{filename}" end.compact end diff --git a/Library/Homebrew/compat/tap.rb b/Library/Homebrew/compat/tap.rb index 1fd53058a5..13c667f286 100644 --- a/Library/Homebrew/compat/tap.rb +++ b/Library/Homebrew/compat/tap.rb @@ -13,20 +13,17 @@ class Tap old_name = name old_path = path - old_remote = path.git_origin + old_remote = remote + clear_cache super(new_user, new_repo) - @repo_var = nil - new_initial_revision_var = "HOMEBREW_UPDATE_BEFORE#{repo_var}" new_current_revision_var = "HOMEBREW_UPDATE_AFTER#{repo_var}" ENV[new_initial_revision_var] ||= ENV[old_initial_revision_var] ENV[new_current_revision_var] ||= ENV[old_current_revision_var] - return unless old_path.git? - new_name = name new_path = path new_remote = default_remote @@ -37,6 +34,8 @@ class Tap path.dirname.mkpath FileUtils.mv old_path, new_path + return unless old_path.git? + puts "Changing remote from #{old_remote} to #{new_remote}..." if $stdout.tty? new_path.git_origin = new_remote end diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index eec9c175ab..fa167c5a89 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -84,6 +84,7 @@ class Tap # clear internal cache def clear_cache @remote = nil + @repo_var = nil @formula_dir = nil @cask_dir = nil @formula_files = nil