2238 Commits

Author SHA1 Message Date
Markus Reiter
5828eefd01 Remove to_s from some Pathnames. 2017-05-08 13:37:28 +02:00
Mike McQuaid
9853a78397 Travis CI tweaks.
Attempt to improve Travis CI. This time without any vendoring gems
nonsense.
2017-05-08 08:38:25 +01:00
Mike McQuaid
57db2e539e Revert "Merge pull request #2597 from MikeMcQuaid/vendor-gems"
This reverts commit 3e4547f52e7ebec633f8bfefc8a396d944edf908, reversing
changes made to 6edf9382bcc1240ad6f97c8b752cfe56cef9965d.
2017-05-07 17:28:39 +01:00
Mike McQuaid
e1bbab6ca6 Revert "Merge pull request #2603 from MikeMcQuaid/tweak-gem-vendoring"
This reverts commit 2372872974d1049c2beafe7dedb7f8f882502058, reversing
changes made to 3e4547f52e7ebec633f8bfefc8a396d944edf908.
2017-05-07 17:28:37 +01:00
Mike McQuaid
33f83be10e Tweak Gem vendoring.
If people have `HOMEBREW_RUBY_PATH` set then things explode in a rather
confusing fashion. Instead, run `bundle` for them with the arguments
that they'd want.

Also, move `macho` requires into the module itself; it's a pain having
to do everything for Bundler before requiring `pathname` which is a core
Ruby class.
2017-05-07 15:33:54 +01:00
Mike McQuaid
ee253e465b Vendor all Homebrew's gems.
Homebrew's actually ended up using a fair few gems. While we want to
avoid Bundler at runtime (and this PR still does that, in fact uses
Bundler even less at runtime than it did before) writing our own version
to use at build-time seems redundant.
2017-05-07 13:52:57 +01:00
Mike McQuaid
555505ec54 Merge pull request #2531 from GauthamGoli/audit_cops_options_refactor
audit: Allow skipping/selective running of cops and cops refactor
2017-05-03 11:28:25 +01:00
Mike McQuaid
e1ef37953f Merge pull request #2577 from DomT4/keg_only_style_tweaks
caveats: tweak keg_only style
2017-05-03 11:19:33 +01:00
Gautham Goli
fed668b330 Add --only-cops,--except-cops options for brew style and simplify cop names 2017-05-03 14:49:23 +05:30
Mike McQuaid
f951a22bea Install etc/var files on postinstall.
Also, don't delete them after that. This means that `brew postinstall`
becomes a way to easily reinstall configuration files for any formula
without needing any changes to any bottles or requiring a reinstall.
2017-05-03 09:00:17 +01:00
Dominyk Tiller
bf491e5102
audit_spec: add keg_only_style tests 2017-05-02 20:08:30 +01:00
Gautham Goli
c3330c289d Add --only-cops,--except-cops options for brew audit
Also refactor audit cops into two "departments"
 - FormulaAudit
 - FormulaAuditStrict
2017-05-02 23:26:12 +05:30
Markus Reiter
1be5eeec26 Add test and comment for PATH#existing. 2017-04-30 21:23:12 +02:00
Markus Reiter
1c7238e59b Add tests for PATH#select and PATH#reject. 2017-04-30 21:18:06 +02:00
Markus Reiter
4d5d6a65e3 Rename PATH#validate to PATH#existing. 2017-04-30 21:11:28 +02:00
Markus Reiter
22f624b373 Make PATH enumerable. 2017-04-30 21:11:28 +02:00
Markus Reiter
e70f2ec332 Make sure duplicates are remove from PATH. 2017-04-30 21:11:28 +02:00
Markus Reiter
a16746906d Add PATH class. 2017-04-30 21:11:27 +02:00
Dominyk Tiller
ed1ae19aee
audit_spec: test go get ban 2017-04-28 18:13:38 +01:00
Mike McQuaid
18c2713df4 formula_installer: improve install/upgrade message
If you `brew install` a formula that's already installed you get:
  Warning: ripgrep-0.5.1 already installed

If you `brew install` an outdated formula that's installed you get:
  Error: ripgrep-0.5.1 already installed. To install this version, first
  `brew unlink ripgrep`

Instead, suggest that the user should `brew upgrade` in this case. If
the formula isn't outdated use the previous message.
2017-04-25 12:45:39 +01:00
Markus Reiter
4b804389e1 Add test for GitHub::search_code. 2017-04-25 12:29:01 +02:00
Markus Reiter
238cd5430f Add remote search to brew cask search. 2017-04-25 12:29:01 +02:00
Markus Reiter
2bda194bd9 Add GitHub::search_code method. 2017-04-25 12:29:01 +02:00
Mike McQuaid
b3c69aba87 search: use single HTTP call for tap searches.
Use GitHub's code search API to search using the filename based on the
search query. This means we only need a single HTTP call and no more
multithreading madness. This also means we're able to search everything
in the Homebrew and Caskroom organisation by default without having to
maintain a list of things to search (and not) in here.
2017-04-24 14:11:04 +01:00
Mike McQuaid
6b0afa3e9c Remove puts_hash, require pp
I wasn’t aware this existed when I created puts_hash so: may as well
remove it.
2017-04-24 11:45:32 +01:00
Mike McQuaid
ceb1629ad7 Merge pull request #2465 from GauthamGoli/audit_components_port_rubocop
audit: audit_components method to rubocops and tests
2017-04-24 10:06:41 +01:00
Mike McQuaid
cf01485318 Merge pull request #2534 from MikeMcQuaid/which_editor_args
utils: make which_editor handle editor args.
2017-04-24 10:02:45 +01:00
Mike McQuaid
5b14d731ba Merge pull request #2490 from retokromer/patch-1
add date-based versioning
2017-04-24 08:52:53 +01:00
Mike McQuaid
3e40059f8d utils: make which_editor handle editor args.
Handle cases like e.g. `EDITOR="subl -w"`.
2017-04-24 08:49:11 +01:00
Mike McQuaid
d5155256ce Fix audit version_scheme and revision checks.
Another attempt at fixing `brew audit` issues around detecting
`revision` and `version_scheme` changes correctly. First done in #1754
and #2086 (reverted in #2099 and #2100).

To ease future debugging a `ph` helper has been added to print a hash
and a series of RSpec tests to verify that the `revision`,
`version_scheme` and `version` formula version audits behave as
expected.

Fixes #1731.
2017-04-23 18:56:22 +01:00
Mike McQuaid
45a7730f61 Fix and remove various TODOs.
Fix those that can be done so without tearing Homebrew to pieces and
remove the comments for those that can never be done.
2017-04-23 15:10:18 +01:00
Mike McQuaid
11acadaa50 Merge pull request #2524 from MikeMcQuaid/more-env-filtering-fixes
Hide sensitive tokens from install/test/post.
2017-04-23 09:45:47 +01:00
Markus Reiter
cb17a80577 Merge pull request #2362 from joshka/install-uninstall-messages
Install uninstall messages
2017-04-23 02:40:52 +02:00
Markus Reiter
5bf0745ece Merge pull request #2514 from reitermarkus/refactor-cask-metadata
Refactor cask metadata directory methods.
2017-04-22 22:01:53 +02:00
Mike McQuaid
a937ed0a20 Merge pull request #2522 from MikeMcQuaid/more-deprecations
More deprecations.
2017-04-22 17:47:39 +01:00
Gautham Goli
413a7e5dae Port audit_components method to rubocops and add corresponding tests 2017-04-22 21:53:16 +05:30
Mike McQuaid
114e8c5537 Merge pull request #2515 from MikeMcQuaid/travis-cache-bundler
travis.yml: cache Bundler output.
2017-04-22 17:11:06 +01:00
Mike McQuaid
d02b4f321d Hide sensitive tokens from install/test/post.
Hide these tokens to avoid malicious subprocesses e.g. sending them
over the network. Also, support using these tokens with environment
filtering and clear `HOMEBREW_PATH` from subprocesses to stop them
sniffing it. Finally, use `HOMEBREW_PATH` to detect Homebrew’s user’s
PATH for e.g. `brew doctor` etc.
2017-04-22 16:31:19 +01:00
Mike McQuaid
ba3c46d24f More deprecations.
Deprecate more methods. Internal APIs have been verified to be unused
elsewhere and removed. External APIs have had deprecation methods added.
Existing deprecations have been either upgraded to produce warnings or
no longer deprecated and the reasoning documented.
2017-04-22 16:28:07 +01:00
Mike McQuaid
62764485c7 travis.yml: cache Bundler output.
Travis needs some coaxing to find where we put it. This should improve
build reliability due to network issues.
2017-04-22 15:44:47 +01:00
Mike McQuaid
a6df701fad tests: reduce some noise.
- Tweak the way offline skipping happens
- Skip more tests that break when offline
- Hide more stdout output from tests.
2017-04-22 12:49:14 +01:00
Mike McQuaid
69c7a20896 Fix brew edit with environment filtering.
For many people `brew edit` makes use of the `EDITOR` variable to pick a
sensible editor. With environment filtering enabled unless this editor
is found in the default system PATH it'll fall back to e.g. `vim`.

Instead, ensure that we export the original, pre-filtering `PATH` as
`HOMEBREW_PATH` and use that internally to locate the editor. In future
this same approach will likely be used for requirements to be able to
find tools, too, and for other variables which we want to expose to
Homebrew itself but not other build tools.

Note that `HOMEBREW_PATH` is the same as `PATH` when build filtering
hasn't been enabled.
2017-04-21 18:26:12 +01:00
Markus Reiter
75ceed39e6 Merge pull request #2520 from reitermarkus/pkgutil-plist
Partly revert “Fix `uninstall :pkgutil` leaving empty `.app` directories.”.
2017-04-21 17:37:42 +02:00
Markus Reiter
80e09c8dec Partly revert “Fix uninstall :pkgutil leaving empty .app directories.”. 2017-04-21 16:46:39 +02:00
Markus Reiter
5c51c4e23b Fix test for chmod +x on binaries. 2017-04-21 14:52:35 +02:00
Markus Reiter
1cd125e7e7 Refactor cask metadata directory methods. 2017-04-21 01:28:21 +02:00
Mike McQuaid
2be7999878 Merge pull request #2274 from rwhogg/fuse-requirement
Port OsxfuseRequirement to Linux
2017-04-20 17:14:42 +01:00
Reto Kromer
7e76740172 move before dash version style 2017-04-18 11:41:55 +02:00
Mike McQuaid
3f8722c971 audit: allow skipping audit methods.
Add `--only` and `--except` methods which can be used to selectively
enable or disable audit groups.
2017-04-18 08:17:26 +01:00
Reto Kromer
0dc6871d22 add test 2017-04-17 18:11:11 +02:00