From 43fc7423d7db1d0cd0b4ef2524815d8ee4ed589c Mon Sep 17 00:00:00 2001 From: Samuel John Date: Wed, 21 Aug 2013 20:18:55 +0200 Subject: [PATCH] brew reinstall: Is able to work for all formulae ... and not just installed ones. Of course, strictly speaking, reinstalling not-yet-installed formulae makes semantically little sense, but the big win is that we can tell people (after we have resolved an issue) to `brew reinstall ` and even if a user has removed that formula in the meantime, reinstall will do the right thing. Basically adding --force to uninstall. I think this makes reinstall more robust. --- Library/Homebrew/cmd/reinstall.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index e7abd8d4db..e5ba1c8f4a 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -6,6 +6,9 @@ module Homebrew extend self # At first save the named formulae and remove them from ARGV named = ARGV.named ARGV.delete_if { |arg| named.include? arg } + # We add --force because then uninstall always succeeds and so reinstall + # works for formulae not yet installed. + ARGV << "--force" clean_ARGV = ARGV.clone # Add the used_options for each named formula separately so