brew list --unbrewed

Very quick way to find files not installed by homebrew.

Taken from a command by mxcl on the homebrew wiki.

.DS_Store files and bin/brew are ignored.
This commit is contained in:
Kieran Pilkington 2009-09-25 19:04:34 +12:00 committed by Max Howell
parent 14818039ae
commit aedaaf79bf
3 changed files with 15 additions and 2 deletions

View File

@ -89,7 +89,7 @@ Commands:
install formula ... [--debug|-d] [--interactive|-i] [--ignore-dependencies] install formula ... [--debug|-d] [--interactive|-i] [--ignore-dependencies]
remove formula ... remove formula ...
search [regex] search [regex]
list [-v] [formula] ... list [--brewed] [--unbrewed] [formula] ...
link formula ... link formula ...
unlink formula ... unlink formula ...
home formula ... home formula ...

View File

@ -281,6 +281,17 @@ def warn_about_macports_or_fink
end end
def versions_of(keg_name)
`ls #{HOMEBREW_CELLAR}/#{keg_name}`.collect { |version| version.strip }.reverse
end
# Taken from the homebrew wiki (http://wiki.github.com/mxcl/homebrew)
def unbrewed_files
`cd #{HOMEBREW_PREFIX}; find bin etc include lib man share -type f \\( ! -iname ".ds_store" ! -iname "brew" \\)`
end
########################################################## class PrettyListing ########################################################## class PrettyListing
class PrettyListing class PrettyListing
def initialize path def initialize path

View File

@ -39,7 +39,9 @@ begin
end end
when 'ls', 'list' when 'ls', 'list'
if ARGV.named_empty? if ARGV.flag? '--unbrewed'
puts unbrewed_files
elsif ARGV.named_empty?
ENV['CLICOLOR']=nil ENV['CLICOLOR']=nil
exec 'ls', *ARGV.options<<HOMEBREW_CELLAR exec 'ls', *ARGV.options<<HOMEBREW_CELLAR
elsif ARGV.verbose? or not $stdout.tty? elsif ARGV.verbose? or not $stdout.tty?