From 6858c00febc4d326f654eb0d6b89fd0083b01ddf Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 1 Jan 2012 15:27:21 -0600 Subject: [PATCH] info: always mark currently linked keg with * When multiple kegs are installed, `brew info` marks a keg with an asterisk if f.installed_prefix == keg, but this is only true if either HEAD or the newest version of the formula is installed. This isn't always useful, so let's mark the currently linked keg with an asterisk regardless of the version. Obviously, keg-only formula will never be marked, but this is probably a feature. When multiple keg-only kegs exist, chances are that they are each being utilized by something, so there isn't really a "used" and "unused" version. Signed-off-by: Jack Nagel --- Library/Homebrew/cmd/info.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 59c39ebe9f..0c6b3829e2 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -1,5 +1,6 @@ require 'formula' require 'tab' +require 'keg' module Homebrew extend self def info @@ -56,7 +57,7 @@ module Homebrew extend self kegs.each do |keg| next if keg.basename.to_s == '.DS_Store' print "#{keg} (#{keg.abv})" - print " *" if f.installed_prefix == keg and kegs.length > 1 + print " *" if Keg.new(keg).linked? and kegs.length > 1 puts tab = Tab.for_keg keg unless tab.used_options.empty?