5401 Commits

Author SHA1 Message Date
Douglas Eichelberger
02e2772e9d Port Homebrew::Cmd::CommandsCmd 2024-03-29 18:53:07 -07:00
Douglas Eichelberger
adf47bb11b Port Homebrew::Cmd::Cleanup 2024-03-29 18:53:07 -07:00
Douglas Eichelberger
a8f8c65d93 Port Homebrew::Cmd::Autoremove 2024-03-29 18:53:07 -07:00
Douglas Eichelberger
c50fb2dbd2 Remove redundant cli/parser requires 2024-03-29 18:53:07 -07:00
Douglas Eichelberger
3cedf33150 Port Homebrew::Cmd::Analytics 2024-03-29 18:53:07 -07:00
Bo Anderson
dd382487c7
Sort kegs based on version scheme 2024-03-29 23:33:41 +00:00
Bo Anderson
2f05b47242
Fix setup-ruby/rubocop issues when euid != uid 2024-03-28 15:39:07 +00:00
Douglas Eichelberger
aad08cd5a4 Revert using hash accessors for args 2024-03-15 12:51:03 -07:00
Douglas Eichelberger
7c7444c2a5 No longer need to thread args 2024-03-15 12:46:06 -07:00
Douglas Eichelberger
96fc8bf66b bracket access over public_send 2024-03-15 12:46:05 -07:00
Douglas Eichelberger
fd652148fa Implement cmd_args block 2024-03-15 12:46:05 -07:00
Douglas Eichelberger
cbcb221de6 Create AbstractCommand class 2024-03-15 12:46:05 -07:00
Mike McQuaid
b1cbe47e45
cmd/update-reset: use stable tag.
Currently we always reset Homebrew/brew onto the latest `master`.
Instead, let's correctly use the latest tag when appropriate.
2024-03-14 16:41:30 +00:00
Kevin
7473e63f38
Merge pull request #16875 from Homebrew/fix-untap-cmd-bugs
Fix untap cmd bugs
2024-03-13 20:17:38 -07:00
Mike McQuaid
b1990ed4b6
Merge pull request #16863 from apainintheneck/memoize-installed-tap-loading-v2
Memoize installed tap loading v2
2024-03-12 08:36:09 +00:00
apainintheneck
ff495a2e44 untap: add new module to make these refactored methods easier to test 2024-03-10 22:33:33 -07:00
apainintheneck
46a32f90c4 cmd/untap: refactor logic into methods to facilitate testing 2024-03-10 22:33:33 -07:00
apainintheneck
819af3cbdd cmd/untap: fix installed formula & cask check
This wasn't working before for a few reasons.

1. It never got past the installed name check because the
installed name sets had short names and the tap names were
long names including the tap namespace too. Now we just trim the
long name before comparing it to the installed name set.

Before:

```
["name"].include?("tap/full/name") # always false
```

After:

```
["name"].include("tap/full/name".split("/").last) # sometimes true
```

2. The names we were trying to load formulae and casks with
were incorrect.

Before:

```
tap = Tap.fetch("homebrew/cask-versions")
token = "homebrew/cask-versions/token"

cask = Cask::CaskLoader.load("#{tap}/#{token}")
```

After:

```
token = "homebrew/cask-versions/token"
cask = CaskCaskLoader.load(token)
```
2024-03-10 22:33:33 -07:00
apainintheneck
fb8c0d2b30 s/Tap.select(&:installed?)/Tap.installed/ 2024-03-08 23:22:00 -08:00
Mike McQuaid
9ac31827a0
Various brew update behaviour improvements
- Output a message every time auto-update is run rather than a 3 second
  timer. This makes it more obvious that Homebrew isn't just sitting
  doing nothing for 2.9 seconds.
- Output a message when running `brew update` so Homebrew doesn't just
  sit there silently doing nothing.
- Update all taps when `brew update` is run, not just those hosted on
  GitHub. This makes it more obvious that people don't need to explictly
  run `brew update` "just in case".
- As a result of this, remove `brew tap --force-auto-update` as it's no
  longer necessary.
2024-03-08 16:21:09 +00:00
Mike McQuaid
f1f92d28bf
Merge branch 'master' into lail/add-overwrite-flag-to-brew-upgrade 2024-03-08 08:27:04 +00:00
Bob
3d24da1904 Add support for the --overwrite flag to brew upgrade to govern the keg-linking step
`FormulaInstaller` already supports this (https://github.com/Homebrew/brew/pull/12691) but I didn't wire it up via `brew upgrade` and the two can be used largely interchangeably
2024-03-07 13:13:28 -08:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Douglas Eichelberger
fe439e8320 Apply 'chmod -x' to executables without shebangs 2024-03-06 22:22:49 -08:00
Markus Reiter
3da0f8c4a6
Fix loading casks/formulae from relative paths. 2024-03-01 04:05:15 +01:00
Patrick Linnane
faf399716f
Fix Style/RedundantLineContinuation offenses
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-02-29 09:26:51 -08:00
Markus Reiter
e08e873921
Only show installed taps in brew tap output. 2024-02-28 20:18:55 +01:00
Markus Reiter
18571e8991
Merge pull request #16732 from reitermarkus/repo-var-suffix
Rename `Tap#repo_var` to `Tap#repo_var_suffix`.
2024-02-27 11:26:16 +01:00
Issy Long
f4218a6316
Fix RuboCop Performance/MapCompact offenses
- Rename an iterator variable since it would make the line too long.
2024-02-25 22:59:59 +00:00
Markus Reiter
b29a2cdff3
Add missing local variable.
Co-authored-by: Bo Anderson <mail@boanderson.me>
2024-02-23 17:09:42 +01:00
Markus Reiter
132a87aff5
Rename Tap#repo_var to Tap#repo_var_suffix. 2024-02-23 16:02:29 +01:00
Markus Reiter
ab27efbd9d
Make Tap::each respect the API. 2024-02-22 17:56:47 +01:00
Mike McQuaid
89fd6964f9
Merge pull request #16715 from reitermarkus/tap-ensure-installed
Clean up `Tap#ensure_installed!` usage.
2024-02-22 08:47:48 +00:00
Markus Reiter
9f5e1f2870
Clean up Tap#ensure_installed! usage. 2024-02-21 03:21:02 +01:00
Markus Reiter
771193c80a
Ensure readall runs without API. 2024-02-20 20:44:14 +01:00
Mike McQuaid
d33efcda9c
Merge pull request #16556 from PauloPhagula/patch-1
fix: use recommended way of updating Fish shell $PATH
2024-02-19 14:44:49 +00:00
Sharon Azriel
a1fbbc323a [update.sh] New test with protection of Homebrew directory 2024-02-13 10:02:18 +02:00
sazriel26
807b3e3394 Update Library/Homebrew/cmd/update.sh
https://github.com/Homebrew/brew/pull/16289#discussion_r1448765696

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2024-02-13 10:02:18 +02:00
Sharon Azriel
835762b289 Ready for review? 2024-02-13 10:02:18 +02:00
sazriel26
3d0f543b63 Update Library/Homebrew/cmd/update.sh
Remove one empty line?

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2024-02-13 10:02:18 +02:00
Sharon Azriel
d9a38e76a9 Brew style --fix (applied) 2024-02-13 10:02:18 +02:00
Sharon Azriel
4a37e81179 Rewrite of branching tests in parsing URL 2024-02-13 10:02:18 +02:00
Sharon Azriel
2833a217e9 [Library/Homebrew/cmd/update.sh] Add support for token provided w/o user in URL 2024-02-13 10:02:18 +02:00
Sharon Azriel
3619636f7f [Library/Homebrew/cmd/update.sh] Release Candidate for pull request 2024-02-13 10:02:18 +02:00
Sharon Azriel
53c261814e Fix brew style on update.sh (2) 2024-02-13 10:02:18 +02:00
Sharon Azriel
02a8de72d6 Fix brew style on update.sh 2024-02-13 10:02:17 +02:00
Sharon Azriel
07287982f2 Fix missing ; 2024-02-13 10:02:17 +02:00
Sharon Azriel
01d1e9b228 New implementation through BASH regexes match 2024-02-13 10:02:17 +02:00
sazriel26
a1e9e93902 Update Library/Homebrew/cmd/update.sh
better wording

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2024-02-13 10:02:17 +02:00
Sharon Azriel
154a8c398b Release Candidate 2 2024-02-13 10:02:17 +02:00