4632 Commits

Author SHA1 Message Date
neutric
f426f1f51f cmd/cleanup.rb: description style tweak 2021-12-31 03:24:34 +01:00
Logicer
e7b71eef22 autoremove: Return when not removing 2021-12-31 11:51:18 +11:00
Mike McQuaid
0b14b6d76d
Merge pull request #12641 from hyuraku/cmd/autoremove_cask_dependencies
cmd/autoremove recognize cask dependencies
2021-12-30 13:29:37 +00:00
hyuraku
4fb6a84139 repair if condition and style 2021-12-29 23:07:11 +09:00
Mike McQuaid
510bc25db6
brew style -fix 2021-12-29 13:07:39 +00:00
hyuraku
65ddf19609 cmd/autoremove recognize cask dependencies 2021-12-28 11:48:58 +09:00
Mike McQuaid
d3252ec2a8
Merge pull request #12576 from thomvaill/fix-vendor-install-private-registry-token
Take `$HOMEBREW_DOCKER_REGISTRY_TOKEN` into account when installing portable-ruby
2021-12-17 14:27:54 +00:00
Bo Anderson
6e37c67fba
Fix disabled args appearing in documentation. 2021-12-17 02:02:45 +00:00
Thomas Vaillant
0266d77b0f fix: take $HOMEBREW_DOCKER_REGISTRY_TOKEN into account when installing portable Ruby 2021-12-16 18:50:58 +01:00
Carlo Cabrera
00137dda8e
Check that ${HOMEBREW_PREFIX}/bin is first in PATH 2021-12-09 20:50:47 +08:00
Carlo Cabrera
a62e88304b
shellenv: check that Homebrew's prefix precedes /usr/bin
Some setups (e.g. a default `tmux` session) will result in a user
starting multiple nested login shells. This is a problem for the way we
currently handle `shellenv` because a login shell invokes
`/usr/libexec/path_helper` which will prepend the contents of
`/etc/paths` and `/etc/paths.d` to `PATH`. In particular, the second
login shell will place `brew` further down the `PATH` than desired in a
non-`/usr/local` prefix, since `brew shellenv` will no longer produce
output the second time around.

Let's fix this by replacing the check that `brew` is in `PATH` with a
check that `${HOMEBREW_PREFIX}/bin` precedes `/usr/bin` in `PATH`.

Fixes #11851, #11883, Homebrew/discussions#2547.

See also:
- Homebrew/discussions#2237
- https://superuser.com/questions/544989/does-tmux-sort-the-path-variable
2021-12-09 20:50:22 +08:00
Julian Pawlowski
29f08603bf
Add support for PowerShell-preview package 2021-12-01 09:55:33 +01:00
Julian Pawlowski
cec3f2190a
Add shellenv template for PowerShell 2021-11-30 10:47:56 +01:00
Mike McQuaid
11c5f8f05a
Improve discovery of some environment variables
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:

- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents

For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves.
2021-11-25 09:10:59 +00:00
fn ⌃ ⌥
9b611be759 Print given argument instead of rename if matching keg not found 2021-11-24 11:39:52 -08:00
Xuehai Pan
62a63063bb Apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Signed-off-by: XuehaiPan <XuehaiPan@pku.edu.cn>
2021-11-24 01:06:27 +08:00
XuehaiPan
466f29a16a cmd/update-report: redirect stdout to stderr when it is not a TTY 2021-11-23 23:55:06 +08:00
Mike McQuaid
a0660e9c1b
Merge pull request #12448 from FnControlOption/renames
Print warning if given old short name of renamed formula
2021-11-19 12:20:12 +00:00
fn ⌃ ⌥
b766799d95 Add missing --formulae/--casks aliases for --formula/--cask 2021-11-18 12:41:03 -08:00
fn ⌃ ⌥
55fc6e1c9b migrate: load specified formulae by keg to avoid rename warning 2021-11-18 09:47:25 -08:00
fn ⌃ ⌥
87e9a495d1 deps: add --graph and --dot switches 2021-11-16 08:50:39 -08:00
fn ⌃ ⌥
a188215d69 deps: minor refactoring 2021-11-16 08:45:59 -08:00
EricFromCanada
6e0e96eb1d
list: raise NoSuchKegError if formula exists but isn't installed 2021-11-11 17:40:32 -05:00
Carlo Cabrera
49de2b0c1a
Check arch instead of the brand string 2021-11-11 17:30:02 +08:00
Carlo Cabrera
98b33e6732
Remove another redundant conditional
This condition is always true when we've reached this branch.
2021-11-11 16:28:15 +08:00
Carlo Cabrera
fd1ca7e2b7
Remove redundant conditionals
Whenever the `sysctl` call does not match `"Apple"*`, we can be sure
that `HOMEBREW_PROCESSOR` is `Intel`, so there's no need for this
additional check.
2021-11-11 16:24:59 +08:00
Carlo Cabrera
51ab1649fb
Install Portable Ruby on native ARM installs
The previous commit only prevented the installation of an Intel Portable
Ruby into `/opt/homebrew` prefix. Let's actually install an ARM64
Portable Ruby there too.
2021-11-11 16:21:35 +08:00
Carlo Cabrera
8aeb28781c
vendor-install: handle native ARM running under Rosetta
Since `HOMEBREW_PROCESSOR` is populated using `uname -m`, this will
register as `Intel` even when a native ARM install is running under
Rosetta.

Let's work around this by checking `sysctl -n machdep.cpu.brand_string`.
On my Intel machine:

    ❯ sysctl -n machdep.cpu.brand_string
    Intel(R) Core(TM) i3-1000NG4 CPU @ 1.10GHz

On Apple Silicon:

    brew@HMBRW-A-001-M1-001 ~ % sysctl -n machdep.cpu.brand_string
    Apple M1

The case of a Rosetta installation of Homebrew is already handled below
the proposed change.

Fixes Homebrew/discussions#2434.
2021-11-11 16:06:33 +08:00
Carlo Cabrera
df2ded4e96
Merge pull request #12386 from FnControlOption/search
search: split up command into multiple methods
2021-11-10 20:57:04 +08:00
Bo Anderson
188265544b
cmd/vendor-install: add arm64 macOS portable-ruby build 2021-11-08 19:20:40 +00:00
fn ⌃ ⌥
4698dfe9ae search: print newline if neither --formula nor --cask specified 2021-11-08 08:55:18 -08:00
fn ⌃ ⌥
9438dc94e3 search: split missing formula help into its own method 2021-11-08 08:55:18 -08:00
fn ⌃ ⌥
896aff0cf2 search: split up command into multiple methods 2021-11-08 08:55:18 -08:00
XuehaiPan
cf7def0c68
style: apply shellcheck autofix 2021-11-08 03:07:25 +00:00
Mike McQuaid
342f8e1e71
vendor-install: better handle /usr/local arm64 ruby.
Fixes https://github.com/Homebrew/brew/issues/12351
2021-11-05 12:35:46 +00:00
Rylan Polster
6db19212c6
Fix brew untap with HOMEBREW_INSTALL_FROM_API 2021-10-28 17:13:34 -04:00
Rylan Polster
9fee68c500
Fix installing from API with tap names 2021-10-28 01:25:27 -04:00
Rylan Polster
7bb69e0b4c
Fix brew install with tap regex 2021-10-27 01:42:08 -04:00
Mike McQuaid
25e61f65db
cmd/update-report: check core tap is installed.
Otherwise `CoreTap.instance.linuxbrew_core?` can fail.
2021-10-25 16:52:29 +01:00
Rylan Polster
0b8032d421
Document HOMEBREW_INSTALL_FROM_API 2021-10-22 12:37:57 -04:00
Rylan Polster
8193807f8d
update-report: fix unset cask repo variable error 2021-10-21 18:33:44 -04:00
Mike McQuaid
0118e6ec41
Apply suggestions from code review
Co-authored-by: Xuehai Pan <XuehaiPan@outlook.com>
2021-10-21 15:10:17 +01:00
Mike McQuaid
eb1b244fd2
update-report: better handle user set bottle domain, core git remote.
Unset these variables and print a warning if they were set to
non-default values.
2021-10-21 15:01:58 +01:00
Bo Anderson
cd808983bc
Portable Ruby 2.6.8 2021-10-21 02:24:50 +01:00
Michka Popoff
1cc7ca33c0
update: migrate everyone from linuxbrew-core to homebrew-core
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-10-20 11:01:38 +01:00
Bob Lail
c3e48b004d
Add HOMEBREW_SSH_CONFIG_PATH
This allows specifying the path of an SSH config file that Homebrew should use instead of the default, `~/.ssh/config`, when fetching Git repos over SSH.
2021-10-20 09:01:57 +01:00
Dawid Dziurla
79293a3518
Merge pull request #12255 from carlocab/search-arch
cmd/search: add Arch Linux
2021-10-20 02:03:35 +02:00
Mike McQuaid
f65d525693
Deprecations/disables for 3.3.0/4.0.0.
Deprecate, disable and remove code for Homebrew 3.3.0 or 4.0.0
(whichever the next release ends up being).
2021-10-19 16:36:42 +01:00
Carlo Cabrera
93340e08d5
cmd/search: add Arch Linux
Arch update their packages very quickly, so they're quite useful as a
reference for building formulae.
2021-10-19 04:40:00 +08:00
Carlo Cabrera
238387d694
Use HOMEBREW_DEFAULT_PREFIX instead of /usr/local
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-10-15 00:17:55 +08:00