From 96449a94e004ccd71e266741fde041769f8e4014 Mon Sep 17 00:00:00 2001 From: Asutosh Palai Date: Wed, 4 Jan 2023 21:46:30 +0000 Subject: [PATCH 1/2] restoring the original path after update This fix is required for ARM Linux where portable Homebrew Portable Ruby is not available. Without this fix, after auto update, brew is restarted with cleaned up path. This causes it to pick not find user installed Ruby by RVM or rbenv, causing brew to fail. --- Library/Homebrew/brew.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 8d34654da7..5f27410d12 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -277,6 +277,9 @@ auto-update() { unset HOMEBREW_AUTO_UPDATING + # restore old path for user installed Ruby version. + export PATH=${HOMEBREW_PATH} + # exec a new process to set any new environment variables. exec "${HOMEBREW_BREW_FILE}" "$@" fi From a85e1a3e5a4bc0d5303dfc531fe5bc1c0518f37f Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 5 Jan 2023 09:59:30 +0000 Subject: [PATCH 2/2] brew.sh: tweak comment. --- Library/Homebrew/brew.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 5f27410d12..1917317a28 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -277,7 +277,7 @@ auto-update() { unset HOMEBREW_AUTO_UPDATING - # restore old path for user installed Ruby version. + # Restore user path as it'll be refiltered by HOMEBREW_BREW_FILE (bin/brew) export PATH=${HOMEBREW_PATH} # exec a new process to set any new environment variables.