From dd551a8060e3e00697ed9912d88edd991124e54d Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Thu, 13 Jan 2022 23:57:51 +0800 Subject: [PATCH] install: respect pins when auto-upgrading Closes #12716. --- Library/Homebrew/install.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index 24b02c78e..c4adcfe94 100644 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -125,7 +125,7 @@ module Homebrew # dependencies. Therefore before performing other checks we need to be # sure --force flag is passed. if f.outdated? - unless Homebrew::EnvConfig.no_install_upgrade? + if !Homebrew::EnvConfig.no_install_upgrade? && !f.pinned? puts "#{f.name} #{f.linked_version} is already installed but outdated (so it will be upgraded)." return true end @@ -215,7 +215,7 @@ module Homebrew elsif f.linked? message = "#{f.name} #{f.linked_version} is already installed" if f.outdated? && !head - unless Homebrew::EnvConfig.no_install_upgrade? + if !Homebrew::EnvConfig.no_install_upgrade? && !f.pinned? puts "#{message} but outdated (so it will be upgraded)." return true end