- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file.
- Use reference counting so nested `CacheStoreDatabase.use` share the
same underlying database (rather than rereading it every time).
- Only write out the cache database file when it has changed.
- Cleanup cache database entries on formula or full `brew cleanup`.
Fixes#8690
Align the logic in `cleanup_portable_ruby` with that in `ruby.sh`.
Co-authored-by: Maxim Belkin <maxim.belkin@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Instead of cleaning every time if the file is missing: don't clean this
time, touch the file and clean when it's next needed.
Now that this feature has been around for longer this makes more sense
for existing installations and stops the first `brew install` run on a
new/test installation without this file always running a `brew cleanup`.
Also, fix up the use of a compat/deprecated method hit by tests by
this change.
If you have /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby (for older OS X versions), then the cleanup tool will nuke everything in usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby. You will need to brew update-reset to get back the old packages.
- avoid calling `rm_ds_store` multiple times when unnecessary
- use native Ruby method to remove `.DS_Store` files as it saves
shelling out to `find` and is a bit quicker.
I benchmarked these both locally and neither use of `Thread.new`
provides any measurable speedup (and in the `readall` case appears to
slow things down) on my 8 core machine.
When a formula and cask share the same name, a download can be
incorrectly considered stale. Only check for if a download is a stale
formula or stale cask, but not both.
Rather than trying to be smart and doing this ourselves in `brew cleanup` let’s just installed Bundler somewhere it doesn’t try to clean itself up and use `bundle install --cleanup` when we need cleanup done.
Also, use `ohai` and `odie` when possible as they look nicer.