4907 Commits

Author SHA1 Message Date
Mike McQuaid
2a5d41d41b
Revert "Merge pull request #14547 from Homebrew/revert-14412-homebrew_install_from_api_default"
This reverts commit f4e60482791d2ff628efadfdbf0d14d9237d2d29, reversing
changes made to e26784f424061ca16987afcb21e036c66a298492.
2023-02-07 19:25:40 +01:00
Mike McQuaid
932d2cf3b7
Merge pull request #14548 from Homebrew/revert-14382-deprecate-disable-remove
Revert "Add deprecations and disables"
2023-02-07 19:11:26 +01:00
Mike McQuaid
f4e6048279
Merge pull request #14547 from Homebrew/revert-14412-homebrew_install_from_api_default
Revert "HOMEBREW_INSTALL_FROM_API: make the default for everyone."
2023-02-07 19:11:14 +01:00
Mike McQuaid
0575903868
Revert "HOMEBREW_INSTALL_FROM_API: make the default for everyone." 2023-02-07 15:13:23 +01:00
Mike McQuaid
6882ac17e7
Revert "Add deprecations and disables" 2023-02-07 15:13:19 +01:00
Mike McQuaid
dbf02366b2
cmd/info: generate --json=v2 from local taps.
Fixes #14541

Co-authored-by: Issy Long <issyl0@github.com>
2023-02-07 15:03:56 +01:00
Bo Anderson
2bb5cdaaa9
Merge pull request #14523 from issyl0/gist-logs-better-token-permissions-message
cmd/gist-logs: On 404, the PAT probably needs more permissions
2023-02-07 01:32:10 +00:00
Issy Long
41b143deec
cmd/gist-logs: On 404, the PAT probably needs more permissions
- This 404 error is from GitHub, and GitHub doesn't give us any more
  informations about scopes for the gist endpoint (for some reason). But we can
  safely assume, as it happens a lot, that "Error: Not Found" (404) is because
  the user hasn't granted their `HOMEBREW_GITHUB_API_TOKEN` the `gist` scope.

Before:

```shell
$ HOMEBREW_GITHUB_API_TOKEN=<token_without_gist_scope> brew gist-logs -p logrotate
Error: Not Found
```

After:

```shell
❯ HOMEBREW_GITHUB_API_TOKEN=<token_without_gist_scope> brew gist-logs logrotate
Error: Your GitHub API token likely doesn't have the `gist` scope.
Create a GitHub personal access token:
https://github.com/settings/tokens/new?scopes=gist&description=Homebrew
echo 'export HOMEBREW_GITHUB_API_TOKEN=your_token_here' >> ~/.zshrc
```
2023-02-06 17:00:02 +01:00
Branch Vincent
8db571e4b0
cmd/doctor: respect --quiet 2023-02-05 15:06:26 -08:00
Mike McQuaid
5f6c69bca2
HOMEBREW_INSTALL_FROM_API: make the default for everyone.
- remove all places we check the flag so it's a no-op now
- flip the messaging to refer to `HOMEBREW_NO_INSTALL_FROM_API` where
  relevant
- adjust the documentation
2023-02-05 18:13:08 +01:00
Mike McQuaid
c1b96e7199
Merge pull request #14382 from MikeMcQuaid/deprecate-disable-remove
Add deprecations and disables
2023-02-05 17:56:58 +01:00
Xuehai Pan
ba3bccf9ed api: download from HOMEBREW_API_DOMAIN 2023-02-04 13:05:20 +00:00
Rylan Polster
9e280f2c44
update: increase max time for API JSON updates 2023-02-03 19:16:30 +01:00
Mike McQuaid
59c03cb2a6
Add deprecations and disables
Do the usual dance:
- commented `odeprecated` to `odeprecated`
- `odeprecated` to `odisabled`
- `odisabled` removed
2023-02-03 10:48:43 +00:00
hyuraku
6945cd7da4 - remove mac/cmd/update-report
- repair if condition
- repair require filename
2023-02-02 18:50:09 +09:00
hyuraku
653930bed8 mv files to os/*/cmd/ 2023-01-28 21:38:40 +09:00
hyuraku
2d864d70e0 apply extend/os to migrate_gcc_dependents_if_needed 2023-01-26 22:21:45 +09:00
Mike McQuaid
91884e0837
cmd/update: tweak API update behaviour.
- Use `HOMEBREW_CASK_REPOSITORY` more consistently
- Skip auto-updating homebrew-core for `HOMEBREW_DEVELOPER` too (without
  explicit `brew update`)
- Also skip auto-updating homebrew-cask
2023-01-26 10:58:21 +00:00
Mike McQuaid
46d727b475
HOMEBREW_INSTALL_FROM_API: various improvements.
- flip the messaging to refer to `HOMEBREW_NO_INSTALL_FROM_API` where relevant
- remove some duplicate checks
- better scope checks to just core tap formulae
2023-01-25 14:29:35 +00:00
apainintheneck
16f4a602b3 cmd/install: fail when pkg not found
The idea here is to facilitate scripting
by always failing whenever a package
is not installed successfully. This is
how the upgrade and reinstall commands
work but not install because we also
search for similar package names before
terminating.
2023-01-20 19:53:00 -08:00
Mike McQuaid
4a03603f68
Add HOMEBREW_NO_INSTALL_FROM_API
This allows HOMEBREW_INSTALL_FROM_API functionality to be disabled and will stick around once
HOMEBREW_INSTALL_FROM_API is made the default behaviour.

Co-authored-by: Eric Knibbe <enk3@outlook.com>
2023-01-18 15:50:13 +00:00
Mike McQuaid
f788765876
cmd/update.sh: use GitHub API token if available.
Fixes https://github.com/Homebrew/brew/issues/14335
2023-01-10 16:13:47 +00:00
謝致邦 (XIE Zhibang)
3d44f0568e
search.rb: Update Fedora URL 2023-01-07 09:13:30 +00:00
Rylan Polster
374b61584b
Load casks from the JSON API with HOMEBREW_INSTALL_FROM_API 2023-01-06 02:46:21 -05:00
apainintheneck
d291117468 Improve install cmd error msg
It now specifies casks, formulae or both in
theh output based upon the user args given.
2022-12-31 15:52:05 -08:00
Mike McQuaid
ba8e40f249
Merge pull request #14286 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-1.41.1
build(deps): bump rubocop from 1.40.0 to 1.41.1 in /Library/Homebrew
2022-12-27 21:20:03 +00:00
Mike McQuaid
b2173e6542
Merge pull request #14259 from cho-m/items-find-devnull
items.sh: return early when no Taps directory
2022-12-27 21:09:29 +00:00
Nanda H Krishna
fe0eb9b5b0
Fix style issues 2022-12-22 23:52:26 -05:00
Michael Cho
a0e9352ad2
cmd/formulae.sh: read cached JSON when using API 2022-12-19 19:41:48 -08:00
apainintheneck
47b3f6fe6e Stop including/extending search.rb
- Instead use class methods.
- This is better than use it as a mixin
  when only a small number of methods are
  used in each class or module.
- It also allows us to conditionally
  require it in `brew install`.
- Removed unused search require in descriptions.rb.
2022-12-17 11:08:13 -08:00
apainintheneck
0ae416d0ee Refactor Search#search_descriptions
- Move cask logic back into method from extend/os and check
  whether to display it based on args since formula?
  is passed by default on Linux now
- Use #search_descriptions in `brew desc` instead of
  duplicating logic
- Remove need for extend/os/search
2022-12-17 10:03:41 -08:00
apainintheneck
cb64bc4df3 Move pkg type logic into search_name
Now the search_name method takes the command line
args and only returns package types that line up
with those args.

That means it will only return casks if casks are valid
and same with formulae.
2022-12-13 22:50:00 -08:00
Kevin
0afc41ceef
Explain edge case in install/cmd
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2022-12-13 20:31:33 -08:00
apainintheneck
daa87fa10f Add specific examples to install cmd
- provide specific install instructions
  when a cask/formula doesn't exist
  and we search for similar ones
- print and exit early if a named formula that
  was removed recently has the same name
- exit early if the tap is specified because
  we don't get good search results
2022-12-12 21:04:59 -08:00
apainintheneck
a481729ade Show casks in install not found output
- Move `search_names` and `print_missing_formula_help` out of `cmd/search.rb` to `search.rb`
- Change to using those functions in `cmd/install.rb` when a formula or cask doesn't exist
2022-12-10 13:02:38 -08:00
Mike McQuaid
28719f7fdc
cmd/desc: fix searching.
Ensure that the cache store is populated if we pass `--eval-all`.
2022-12-06 13:56:54 +00:00
apainintheneck
00990e34a7 Merge branch 'master' into create-cop-for-os-checks 2022-11-29 23:14:15 -08:00
apainintheneck
c477b9aab3 Cleanup after adding os specific rubocop
- Change name of rubocop warning
- Disable linting on remaining offending lines
- Add todos to move lines with disabled linting
  checks to extend/os in the future
2022-11-29 23:13:50 -08:00
Ian Gregory
9013ca2a22 Prevent brew casks from finding formulae at tap root 2022-11-20 16:22:18 -05:00
Mike McQuaid
8145d516e2
cmd/search: better handle non-TTY output.
When `stdout` is not a TTY then using `ohai` is a bit unpleasant as it
prevents using pipes to do cool things with the output.
2022-11-01 13:51:13 +00:00
Ian Gregory
a0f915169c Remove --adopt switch from reinstall and upgrade 2022-10-25 19:07:21 -04:00
Ian Gregory
a715dec49d Add --adopt switch
Allows `brew install` & co. to adopt existing cask artifacts that are
identical to those being installed.

Discussion: #14006
2022-10-21 23:28:51 -04:00
Mike McQuaid
34979a33d3
Merge pull request #13997 from hyuraku/add-error-log-for-download-formula.json
add error log of download `formula.json`
2022-10-14 17:35:45 +01:00
Mike McQuaid
e554f51454
cmd/update: tweak error message.
Co-authored-by: Bo Anderson <mail@boanderson.me>
2022-10-14 17:10:50 +01:00
hyuraku
4bc5f48654 compare bytesize instead of shasum256 2022-10-15 00:22:10 +09:00
hyuraku
dc37364248 use ruby script instead of shasum command 2022-10-13 23:46:41 +09:00
hyuraku
f4156378d8 compare formula.json shasum to check brew updated 2022-10-13 23:16:28 +09:00
hyuraku
8843364123 add error log of download formula.json 2022-10-12 22:35:08 +09:00
Bo Anderson
bde685aae2
Merge pull request #13982 from Bo98/ruby3-part1
Preliminary compatibility fixes for Ruby 3
2022-10-11 19:42:57 +01:00
Rylan Polster
174087958b
Simulate all OS/arch combinations in brew readall 2022-10-10 23:56:37 -04:00