This will become the default in a later version of Homebrew but has an
opt-out through HOMEBREW_NO_INSTALL_CLEANUP.
Also, always cleanup files older than 120 days and set the general
default value for "old" logs, casks etc. to 30 days.
It's always seemed a bit pointless to me that we have both of these
commands. Given we're doing more and more to recommend (and eventually,
safely, automatically run (see #4760) `brew cleanup` let's roll their
functionality into a single command.
This makes use of both the existing interfaces and could use the
existing cache file but we'll create a new one and cleanup the old one
to avoid issues and use a more consistent name.
- Cleanup portable ruby if you haven't specifically requested it and
you don't need it. This will be useful when e.g. upgrading OS versions
- Cleanup the old DBM linkage cache. These will not be used again.
- ensure that `HOMEBREW_CELLAR` is always created on `install`.
- remove the need for a special `PRUNEABLE_DIRECTORIES` variable
- reuse values from existing variables and get `uniq`s.
Consolidate the handling of which directories need to exist and which
need to be writable. Additionally, add a fatal check for formula
installations to ensure that any directories that need to be writable
are so before attempting an installation.
Fixes#4626.
If the underneath file system is a Network File System,
`brew cleanup` will fail to remove the lock files with following error
message:
Error: Bad file descriptor @ rb_file_flock - /path/to/the/lock_file
This commit fixes such issue and adds the corresponding test case.
Fixes#2355
Create unremovable_kegs instance var
Check cellar cleanup failure after full cleanup completes
Use module_function in Homebrew::Cleanup as we never instantiate the
class
Since #292, HOMEBREW_CACHE was moved to a per-user directory. This makes
it unsuitable to store global lock files on multiple users environment.
Therefore, introducing a global lock directory `/Library/Lock.d` to
store lock files from formula lockers as well as `brew update`.