From 6fe75fb1542995cdc641ca77f0529bfbb66f958e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 3 Feb 2019 15:32:30 +0100 Subject: [PATCH] cleanup: fix stale cask detection. This method is also run to check formulae and if a formula and cask have the same name (e.g. `cmake`) then this method would mark all formulae downloads to being stale. Instead, check the `dirname` (which we're using for globs anyway) to double check that this is definitely a stale cask. --- Library/Homebrew/cleanup.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index 386d2e5da7..c2c03614ba 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -112,6 +112,8 @@ module CleanupRefinement def stale_cask?(scrub) return false unless name = basename.to_s[/\A(.*?)\-\-/, 1] + return if dirname.basename.to_s != "Cask" + cask = begin Cask::CaskLoader.load(name) rescue Cask::CaskUnavailableError