1155 Commits

Author SHA1 Message Date
Mike McQuaid
5dd8ead51a
Rename Formula#installed? to Formula#latest_version_installed?
This naming has always been a bit weird and confusing so let's change
it and provide a `compat` fallback for later deprecation.
2019-12-03 11:42:42 +00:00
Mike McQuaid
766fc4b301
Fix RuboCop 0.77.0 failures. 2019-11-28 15:10:50 +00:00
Bo Anderson
3cb2d62a1b formula: copy hidden files from bottles. 2019-11-14 23:31:40 +00:00
Mike McQuaid
ee1cbfc8d3
formula: refactor outdated_kegs logic.
- Use the `Formula.cache` and `Cacheable` rather than rolling our own.
- Use keyword arguments instead of `options = {}`
- Improve readability in general
2019-11-06 11:49:31 +00:00
Mike McQuaid
7d77a9e97d
formula: add runtime_installed_formula_dependents method. 2019-11-06 10:04:13 +00:00
Mike McQuaid
ddcbdbe0c0
formula: cache runtime_dependencies related stuff. 2019-11-06 10:04:13 +00:00
Markus Reiter
1ebc63f232 Don't add leading whitespace to _JAVA_OPTIONS. 2019-10-27 18:27:59 +01:00
Issy Long
1f6168fe8a
Change regexp.match?(string) to string.match?(regexp) everywhere
- Only try to call `.match?` on strings that aren't nil.
2019-10-13 23:22:51 +01:00
Issy Long
341ea60807
Auto-fix Style/RedundantBegin offenses
- This also required auto-fixes for Layout/EmptyLinesAroundBlockBody and
  Layout/InconsistentIndentation once the auto-fixer had got rid of the
  "redundant begin"s.
2019-10-13 16:04:27 +01:00
Issy Long
b78028b9c2
Auto-fix Performance/RegexpMatch offenses 2019-10-13 16:04:26 +01:00
Mike McQuaid
0d068341fc
Merge pull request #6467 from EricFromCanada/uses_from_macos-json
Expose `uses_from_macos` list in formula API
2019-10-11 09:28:01 +01:00
Markus Reiter
b1d0c61fea Update Gems. 2019-10-03 09:22:44 +02:00
EricFromCanada
9bd77b1819 formula API: expose uses_from_macos list 2019-09-23 13:00:15 -04:00
Mike McQuaid
99ed23347a
formula: update caveats documentation. 2019-06-20 11:08:02 +01:00
Mike McQuaid
3cfb028e7f
Resource#fetch: verify downloads by default.
This API is used internally correctly and externally mostly correctly
but #6230 reveals the external usage is fairly confusing and a bit
unsafe by default. Preserve the existing API while verifying the
checksum by default and providing an opt-out. Using the existing, safe
method will result in a double verification of the checksum which is
harmless. A Homebrew/homebrew-core PR will follow shortly to address
those cases.

Fixes #6230
2019-06-15 17:22:45 +01:00
Gabriel
aafe87524d Extends SoftwareSpec with #uses_from_macos 2019-06-03 15:52:53 -03:00
Gabriel
412f7d964f Removes formula class extension 2019-06-03 15:52:53 -03:00
Gabriel
0c1da29d0c Add _ to unused args 2019-06-03 15:52:53 -03:00
Gabriel
a7e3304735 Extends Formula class with mac os #uses_from_macos 2019-06-03 15:52:52 -03:00
Gabriel
79808638a6 Add default #uses_from_macos behaviour to Formula 2019-06-03 15:52:52 -03:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
EricFromCanada
15c38a2d8b formatting fixes 2019-04-13 21:29:32 -04:00
Mike McQuaid
d12e39633c
Remove odisabled. 2019-04-01 15:07:50 +01:00
Mike McQuaid
aa940a21a9
Generate and push rubydoc.brew.sh
This is a replacement for the rubydoc.info site that has been a bit
unreliable for us.

Also, note we're using the community Ruby style guide now rather than
the GitHub one.
2019-03-28 21:15:50 +00:00
Ivan Pozdeev
810ae4a45d Add bottle_disabled to brew info --json 2019-03-21 21:04:31 +03:00
Mike McQuaid
d64429a736
rubocop: enable Style/IfUnlessModifier. 2019-02-21 12:55:49 +00:00
Mike McQuaid
f9fda0ffcc
Formula.installed: handle more exceptions.
Regardless of the exception we don't want this method to blow up.

Fixes #5770.
2019-02-20 13:05:36 +00:00
Mike McQuaid
5d729dd310
formula: make JSON caveats output use consistent prefix.
This will avoid this changing depending on the generation location.
2019-02-15 17:39:20 +00:00
Mike McQuaid
d5adf87cf4
cleanup: better handle edge cases.
- don't complain about "skipping" kegs when `brew cleanup` runs
  automatically
- better handle orphaned directories
- output a better error message when a keg cannot be removed

Fixes #4989
Fixes #5627
Fixes https://github.com/Homebrew/homebrew-core/pull/35958#issuecomment-458031634
2019-01-28 16:08:23 +00:00
Mike McQuaid
1aa8ad09e2
Deprecate macOS versions below Mavericks
And remove all dead/unneeded code.
2019-01-27 12:27:47 +00:00
Mike McQuaid
eed1444d61
Update deprecations and cleanup
- Move `odeprecated` to `odisabled`
- Remove `odisabled`
- Enable automatic cleanup on install/reinstall/upgrade.
2019-01-23 21:57:40 +00:00
Mike McQuaid
170c5493a4
Update deprecations
- Add some `odeprecated`
- Make some `odeprecated` now `odisabled`
- Remove `odisabled` code.
- Remove old update migrations
- Remove GCC 4.0 compiler
- Remove Tiger-only code
- Remove 32-bit-only code
- Remove use of LD64
- Remove GCC 4.3 - 4.8 support.
2019-01-08 19:13:46 +00:00
Mike McQuaid
549b02f20a
Manual brew style fixes. 2018-11-02 17:29:26 +00:00
Mike McQuaid
737b84b54b
brew style --fix fixes. 2018-11-02 17:29:23 +00:00
Mike McQuaid
fc418fd333
More deprecated/disabled updates
- remove odisabled
- move odeprecated to odisabled
2018-10-24 10:40:39 +01:00
EricFromCanada
20167e5f1b Adjust comments to tidy API docs output. 2018-10-18 21:42:43 -04:00
Markus Reiter
c4d418e126 Use ActiveSupport’s #second. 2018-10-07 23:10:56 +02:00
Markus Reiter
a37c02982e Fix brew mirror. 2018-10-01 10:28:07 +02:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
commitay
a5af6e8ef4 formula: set CARGO_HOME to enable cache 2018-09-04 12:00:38 +10:00
Mike McQuaid
80d75bc0d8
Homebrew/.rubocop: tweak rules.
Adjust the rules based on the current codebase. Remove various enable,
disables and default values that are unnecessary. Add more comments
explaining why. Make minor changes needed to enable a few more rules.
2018-09-02 20:15:09 +01:00
Mike McQuaid
bcb1ec5499
Improve Homebrew/brew line length.
Use 124 max line length everywhere. Also, reduce tap max line length to
189 as Homebrew/homebrew-core has that as a maximum now. In future
Homebrew/homebrew-core will also be reduced to 124 maximum line length.
2018-09-02 16:15:09 +01:00
Dominyk Tiller
4598995a41
formula: always set GOCACHE
I hadn't planned to move on this so quickly but impressively core
today had its first Go Module using PR, so this has become more useful
than it would've been. Useful reading on the Modules system can be found
via https://golang.org/doc/go1.11#modules.

`GOCACHE` has been a thing for a while but it hasn't really been
especially beneficial to us, so I've ignored it, but with the Go Modules
system it can be incredibly useful in reducing build times & thus CI
burden. A lot of this is explained rather nicely here:
  https://groups.google.com/forum/#!msg/golang-dev/RjSj4bGSmsw/KMHhU8fmAwAJ

The upsides here for us are obvious:
1) We do a *lot* of go-based builds, and the more things move over to the
module system the more comprehensive that cache will become and we'll
need to remotely fetch less dependencies, which massively speeds up
build times even on high-speed connections.
2) Module dependencies aren't limited per formula. If `hugo` fetches a
dependency that is the same version as, for example, `wiki` also needs
`wiki` won't bother to fetch that version remotely but instead will
simply pluck it out of the cache.

If we look at `hugo`, because it's the only formula so far with Module
support:

First build: `built in 1 minute 41 seconds`
Second build: `built in 14 seconds`.

It's worth noting perhaps that we can use just the module cache rather
than the build cache + module cache combination, but doing so leads to
a significant reduction in regained build time. A build under that
system pops an average build time with `hugo` (after the first build)
of ~70 seconds, which is only a 30 second saving on the first build.
However, if we wanted to speed up builds whilst also not eating big chunks
of disk space that is an option.

The downside of a build cache + module cache system is disk usage.
`go` does not exactly eat up disk space sparingly, and the cache size
from `hugo` alone is 258.8MB. That could be an issue on CIs where disk
space is already a squeeze at times, but it's not much different to how
we let the `java_cache` behave now.

All Module-supporting formulae need to do to use the shared cache is
instead of deleting the `GOPATH` env we set everywhere replace it with
this:
```
ENV["GOPATH"] = "#{HOMEBREW_CACHE}/go_cache"
```
2018-08-29 13:16:36 +01:00
Markus Reiter
d33241bc11 Use -- for bottles. 2018-08-06 17:59:51 +02:00
Markus Reiter
13c65eed70 Change docs to use symbols instead of class names. 2018-08-03 17:50:57 +02:00
Mike McQuaid
e52d6dba79 formula: handle unavailable versioned formulae.
If people decide to copy these into their Homebrew/homebrew-core
`Formula` directory then it breaks generating the hash for any
non-versioned formulae.

See https://github.com/Homebrew/homebrew-bundle/issues/351
2018-07-30 09:16:53 +01:00
Mike McQuaid
e63d490874 formula: handle unavailable missing formulae.
Fixes #4494.
2018-07-17 14:59:50 +01:00
Mike McQuaid
375d401580 Handle missing formulae in runtime_dependencies
Hopefully put this to bed for once and for all. Add a new method
`runtime_formulae_dependencies` which returns the `runtime_dependencies`
which have only the `Formula` objects that exist. I've checked all the
`runtime_dependencies` callers and updated them accordingly.

Also, fix a few cases where runtime dependencies were being read from
the tab when this wasn't desirable.
2018-07-16 16:46:39 +01:00
Mike McQuaid
256dfc1af9 Move methods from FileUtils to Formula
These don't need to live on FileUtils and don't really make sense there
either.
2018-07-14 18:13:23 +01:00
Mike McQuaid
abf3043125 formula: move mktemp.
This should be an instance rather than a class method.
2018-07-14 15:41:16 +01:00