Martin Afanasjew e85e57b217 cleanup: make --force less aggressive
Change behavior for `brew cleanup` as follows:

- If `--force` is supplied, remove only outdated keg-only packages.
- If `--prune=<days>` is supplied, remove both logs and cached downloads
  older than the specified number of days. Use `--prune=all` to remove
  all logs and cached downloads irrespective of age.
- By default, remove logs after 14 days and cached downloads never.

Also centralizes handling of `--prune`, thus removing duplicate logic.

This is motivated by commit 17eee232838d4639b25f863aa342b1dda61b81bc
that made `--force` much more aggressive and made it override whatever
was specified via `--prune`, completely removing all:

- outdated keg-only packages
- cached downloads irrespective of age
- logs irrespective of age

This made it impossible to remove outdated keg-only packages without
also deleting all cached downloads, which is at least inconvenient for
people with limited bandwidth wanting to rebuild packages later.

Closes Homebrew/homebrew#42970.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-16 16:47:24 +01:00
..
2015-08-16 16:47:24 +01:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-08-11 20:36:13 +01:00
2015-08-16 17:03:05 +02:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-08-03 20:38:20 +08:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2014-06-23 22:34:41 -05:00
2015-08-03 13:22:35 +01:00
2015-08-14 15:52:56 +08:00
2015-08-06 22:33:46 +08:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-01-13 16:35:24 -05:00
2015-08-03 14:34:12 -07:00
2015-08-03 13:22:35 +01:00
2015-03-12 15:19:02 +00:00
2015-08-03 13:22:35 +01:00
2015-04-15 19:51:54 +08:00
2014-10-26 15:42:41 +00:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-08-03 13:22:35 +01:00
2015-08-09 03:58:21 +01:00
2015-08-13 15:49:46 +08:00
2015-08-03 13:22:35 +01:00

Homebrew Public API

We're (finally) working on a documented public API for Homebrew. It's currently a work in progress; a bunch of public stuff is documented and a bunch of private stuff is undocumented. Sorry about that!

The main class you should look at is {Formula}. Assume everything else is private for now.