From 09ba000be1cd6a2c40ddac1898abac1f6c5744ed Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Sun, 17 Jan 2016 12:59:17 -0800 Subject: [PATCH] Permit cleanup to remove outdated keg-only formulae This check is not really relevant anymore; old-style, pre-opt installs date from 2012 at the very latest, so it is very unlikely that any packages remain which still link against these. Refs Homebrew/homebrew#48139. --- Library/Homebrew/formula.rb | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 3d8e26f444..fc1219a406 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1484,7 +1484,7 @@ class Formula eligible_for_cleanup = [] if installed? eligible_kegs = installed_kegs.select { |k| pkg_version > k.version } - if eligible_kegs.any? && eligible_for_cleanup? + if eligible_kegs.any? eligible_kegs.each do |keg| if keg.linked? opoo "Skipping (old) #{keg} due to it being linked" @@ -1492,8 +1492,6 @@ class Formula eligible_for_cleanup << keg end end - else - eligible_kegs.each { |keg| opoo "Skipping (old) keg-only: #{keg}" } end elsif installed_prefixes.any? && !pinned? # If the cellar only has one version installed, don't complain @@ -1504,25 +1502,6 @@ class Formula eligible_for_cleanup end - # @private - def eligible_for_cleanup? - # It used to be the case that keg-only kegs could not be cleaned up, because - # older brews were built against the full path to the keg-only keg. Then we - # introduced the opt symlink, and built against that instead. So provided - # no brew exists that was built against an old-style keg-only keg, we can - # remove it. - if !keg_only? || ARGV.force? - true - elsif opt_prefix.directory? - # SHA records were added to INSTALL_RECEIPTS the same day as opt symlinks - Formula.installed.select do |f| - f.deps.any? do |d| - d.to_formula.full_name == full_name rescue d.name == name - end - end.all? { |f| f.installed_prefixes.all? { |keg| Tab.for_keg(keg).HEAD } } - end - end - private def exec_cmd(cmd, args, out, logfn)