aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/reinstall.rb
diff options
context:
space:
mode:
authorSamuel John2013-08-21 19:20:41 +0200
committerSamuel John2013-08-21 19:20:41 +0200
commit4bb49a6439ddf3298b5b194b8f870f283778e506 (patch)
tree03f592545a22368188d9201419d3b48868d3ba6b /Library/Homebrew/cmd/reinstall.rb
parentdb1075fdc7be4dbffc558fcb223410a335a42660 (diff)
downloadbrew-4bb49a6439ddf3298b5b194b8f870f283778e506.tar.bz2
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 <formula>` 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.
Diffstat (limited to 'Library/Homebrew/cmd/reinstall.rb')
-rw-r--r--Library/Homebrew/cmd/reinstall.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb
index e7abd8d4d..e5ba1c8f4 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