Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doctor: remove outdated Homebrew check. #1152

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion Library/Homebrew/cmd/doctor.rb
Expand Up @@ -22,7 +22,6 @@ def doctor
slow_checks = %w[
check_for_broken_symlinks
check_missing_deps
check_for_outdated_homebrew
check_for_linked_keg_only_brews
]
methods = (checks.all.sort - slow_checks) + slow_checks
Expand Down
25 changes: 0 additions & 25 deletions Library/Homebrew/diagnostic.rb
Expand Up @@ -961,31 +961,6 @@ def check_for_pydistutils_cfg_in_home
EOS
end

def check_for_outdated_homebrew
return unless Utils.git_available?

timestamp = if File.directory?("#{HOMEBREW_REPOSITORY}/.git")
HOMEBREW_REPOSITORY.cd { `git log -1 --format="%ct" HEAD --`.to_i }
else
HOMEBREW_LIBRARY.mtime.to_i
end
return if Time.now.to_i - timestamp <= 60 * 60 * 24 # 24 hours

if File.directory?("#{HOMEBREW_REPOSITORY}/.git")
HOMEBREW_REPOSITORY.cd do
local = `git rev-parse -q --verify refs/remotes/origin/master`.chomp
remote = /^([a-f0-9]{40})/.match(`git ls-remote origin refs/heads/master 2>/dev/null`)
return if remote.nil? || local == remote[0]
end
end

<<-EOS.undent
Your Homebrew is outdated.
You haven't updated for at least 24 hours. This is a long time in brewland!
To update Homebrew, run `brew update`.
EOS
end

def check_for_unlinked_but_not_keg_only
unlinked = Formula.racks.reject do |rack|
if !(HOMEBREW_LINKED_KEGS/rack.basename).directory?
Expand Down