From e08ef940beaeb8251d7db0645bbc980535f481e5 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Mon, 18 Apr 2011 21:11:08 -0700 Subject: [PATCH] Add --force to brew cleanup --- Library/Contributions/manpages/brew.1.md | 7 +++++-- Library/Homebrew/cmd/cleanup.rb | 2 +- share/man/man1/brew-man.1 | 2 +- share/man/man1/brew.1 | 7 +++++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Library/Contributions/manpages/brew.1.md b/Library/Contributions/manpages/brew.1.md index 3030f3b8d2..8c5b018ca5 100644 --- a/Library/Contributions/manpages/brew.1.md +++ b/Library/Contributions/manpages/brew.1.md @@ -146,9 +146,12 @@ didn't include with OS X. * `cat` : Display the source to . - * `cleanup` []: + * `cleanup [--force]` []: For all installed or specific formulae, remove any older versions from the - cellar. + cellar. By default, does not remove out-of-date keg-only brews, as other + software may link directly to specific versions. + + If `--force` is passed, remove out-of-date keg-only brews as well. * `log [git-log-options]` ...: Show the git log for the given formulae. Options that `git-log`(1) diff --git a/Library/Homebrew/cmd/cleanup.rb b/Library/Homebrew/cmd/cleanup.rb index c01f4b18fc..6254983b9c 100644 --- a/Library/Homebrew/cmd/cleanup.rb +++ b/Library/Homebrew/cmd/cleanup.rb @@ -28,7 +28,7 @@ module Homebrew extend self # Don't clean up keg-only brews for now. # Formulae link directly to them, so cleaning up old # ones will break already compiled software. - if f.keg_only? + if f.keg_only? and not ARGV.force? opoo "Skipping keg-only #{f.name}" if rack.children.length > 1 return end diff --git a/share/man/man1/brew-man.1 b/share/man/man1/brew-man.1 index c3d802e430..24bd05a4e9 100644 --- a/share/man/man1/brew-man.1 +++ b/share/man/man1/brew-man.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "BREW\-MAN" "1" "January 2011" "Homebrew" "brew" +.TH "BREW\-MAN" "1" "March 2011" "Homebrew" "brew" . .SH "NAME" \fBbrew\-man\fR \- Generate man pages for Homebrew diff --git a/share/man/man1/brew.1 b/share/man/man1/brew.1 index c394dd7f6c..e4726c58b3 100644 --- a/share/man/man1/brew.1 +++ b/share/man/man1/brew.1 @@ -163,8 +163,11 @@ Check your system for potential problems\. Display the source to \fIformula\fR\. . .TP -\fBcleanup\fR [\fIformula\fR] -For all installed or specific formulae, remove any older versions from the cellar\. +\fBcleanup [\-\-force]\fR [\fIformula\fR] +For all installed or specific formulae, remove any older versions from the cellar\. By default, does not remove out\-of\-date keg\-only brews, as other software may link directly to specific versions\. +. +.IP +If \fB\-\-force\fR is passed, remove out\-of\-date keg\-only brews as well\. . .TP \fBlog [git\-log\-options]\fR \fIformula\fR \.\.\.