diff options
Diffstat (limited to 'Library/Contributions')
| -rwxr-xr-x | Library/Contributions/examples/brew-missing.rb | 17 | ||||
| -rwxr-xr-x | Library/Contributions/examples/brew-server | 1 | ||||
| -rwxr-xr-x | Library/Contributions/examples/brew-upgrade.rb | 10 |
3 files changed, 10 insertions, 18 deletions
diff --git a/Library/Contributions/examples/brew-missing.rb b/Library/Contributions/examples/brew-missing.rb index 68206278c..701bb1ca2 100755 --- a/Library/Contributions/examples/brew-missing.rb +++ b/Library/Contributions/examples/brew-missing.rb @@ -1,21 +1,18 @@ require "formula" -require 'formula_installer' +require "cmd/outdated" def main # Names of outdated brews; they count as installed. - outdated = outdated_brews.collect {|b| b[1]} + outdated = Homebrew.outdated_brews.collect{ |b| b[1] } - HOMEBREW_CELLAR.subdirs.each do |keg| - next unless keg.subdirs - if ((f = Formula.factory(keg.basename.to_s)).installed? rescue false) - f_deps = FormulaInstaller.expand_deps(f).collect{|g| g.name}.uniq - next if f_deps.empty? - - missing_deps = f_deps.reject do |dep_name| + HOMEBREW_CELLAR.subdirs.each do |rack| + f = Formula.factory rack.basename.to_s rescue nil + if f and f.installed? + missing_deps = f.recursive_deps.map{ |g| g.name }.uniq.reject do |dep_name| Formula.factory(dep_name).installed? or outdated.include?(dep_name) end - puts "#{f.name}: #{missing_deps.join(', ')}" unless missing_deps.empty? + puts "#{f.name}: #{missing_deps * ', '}" unless missing_deps.empty? end end end diff --git a/Library/Contributions/examples/brew-server b/Library/Contributions/examples/brew-server index b9919cf7a..5e7f80b58 100755 --- a/Library/Contributions/examples/brew-server +++ b/Library/Contributions/examples/brew-server @@ -82,7 +82,6 @@ get '/' do end get '/search' do - require 'brew.h' q = params['q'] results = search_brews(q) diff --git a/Library/Contributions/examples/brew-upgrade.rb b/Library/Contributions/examples/brew-upgrade.rb index 6c7831fde..3ffb570ac 100755 --- a/Library/Contributions/examples/brew-upgrade.rb +++ b/Library/Contributions/examples/brew-upgrade.rb @@ -1,11 +1,7 @@ # Updates all outdated brews # See: http://github.com/mxcl/homebrew/issues/issue/1324 -# patch ARGV to use all of the outdated packages as the names passed in -module HomebrewArgvExtension - def formulae - @formulae = outdated_brews.map {|_keg, name, _version| Formula.factory name} - end -end +require 'cmd/outdated' +require 'cmd/install' -brew_install +Homebrew.install_formulae Homebrew.outdated_brews.map{ |_keg, name, _version| Formula.factory name } |
