2273 Commits

Author SHA1 Message Date
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
Misty De Meo
1deb884314 Merge pull request #2496 from mistydemeo/hardware_cpu_can_run_arch_helper
Hardware cpu can run arch helper
2017-04-17 18:01:33 +08:00
Mike McQuaid
46f6dc4c93 Merge pull request #2446 from mansimarkaur/diagnostic_tests
[WIP] Added test for check_access_lock_dir
2017-04-16 09:30:38 +01:00
Bob W. Hogg
608d72a35f OsxfuseRequirement: Port to Linux 2017-04-15 21:20:09 -07:00
Misty De Meo
944bff4de2 Mac Hardware: provide a more Mac-specific implementation of can_run? 2017-04-15 22:59:55 +08:00
Misty De Meo
d7ff53fa1d Hardware: add helper to determine if an executable can be run 2017-04-15 22:59:55 +08:00
Markus Reiter
4d6e31999a Merge pull request #2434 from JCount/gpg-spec-test-21-compatibility
gpg_spec test add 2.1.x compatibility
2017-04-09 21:08:53 +02:00
JCount
43b64bfed1 gpg_spec: use new version method to directly compare version objects 2017-04-08 20:20:26 -04:00
JCount
14a7ef591b gpg_spec: switch structure to if/else instead of rescue 2017-04-08 20:20:26 -04:00
JCount
239b873fb2 gpg2_requirement_spec: switch test to gnupg 2.1.x 2017-04-08 20:19:57 -04:00
mansimarkaur
7e455a623a Corrected test for access_lock_dir 2017-04-07 18:29:40 +05:30
Mike McQuaid
3f51406212 Merge pull request #2242 from GauthamGoli/audit_custom_cops
Port audit_desc audit rules to a cop
2017-04-05 08:37:43 +01:00
mansimarkaur
fda41919cf Added test for check_access_lock_dir 2017-04-03 07:06:59 +05:30
Mike McQuaid
879b3360d3 Handle missing receipt on brew install.
For example if this is for a really old keg, keg where a user has
manually removed stuff or used `brew diy`.
2017-04-02 17:02:56 +01:00
Eugene Nikolsky
edd9a9717c Fix the 'export PATH' message in link for a keg-only formula
Commit 4cae6a724e6d684eb157dd6d7328755694f228b2 introduced the message,
but it printed the wrong path, e.g. for `brew link sqlite`:

```
If you need to have this software first in your PATH instead consider running:
  echo 'export PATH="/usr/local/opt/sqlite:$PATH"' >> ~/.zshrc/bin
```

where `/bin` is appended at the end, but should be inserted before
`:$PATH`: `echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.zshrc`.
This patch fixes that and updates a test to verify it.
2017-04-01 20:12:00 -07:00
JCount
0e1b7ce8ea gpg_spec: make test compatible with gnupg 2.1.x
maintain existing compatibility with gnupg 2.0.x
2017-04-01 21:29:09 -04:00