Skip to content
Snippets Groups Projects
Commit 2ecd73bc authored by Mike McQuaid's avatar Mike McQuaid
Browse files

update-report: migrate on newer auto-update.

If we have a `brew.sh` which has set
`HOMEBREW_ENABLE_AUTO_UPDATE_MIGRATION` then let's allow an auto-update
migration. That's because it contains the fix below it _before_ the
update happened which means the auto-update won't fail in the same way
as if updating from an old version.
parent d9023a65
No related branches found
No related tags found
No related merge requests found
......@@ -267,6 +267,9 @@ update-preinstall() {
[[ -z "$HOMEBREW_NO_AUTO_UPDATE" ]] || return
[[ -z "$HOMEBREW_UPDATE_PREINSTALL" ]] || return
# Allow auto-update migration now we have a fix in place (below in this function).
export HOMEBREW_ENABLE_AUTO_UPDATE_MIGRATION="1"
if [[ "$HOMEBREW_COMMAND" = "install" || "$HOMEBREW_COMMAND" = "upgrade" || "$HOMEBREW_COMMAND" = "tap" ]]
then
brew update --preinstall
......
......@@ -100,7 +100,8 @@ module Homebrew
Homebrew.failed = true if ENV["HOMEBREW_UPDATE_FAILED"]
# This should always be the last thing to run (but skip on auto-update).
unless ARGV.include?("--preinstall")
if !ARGV.include?("--preinstall") ||
ENV["HOMEBREW_ENABLE_AUTO_UPDATE_MIGRATION"]
migrate_legacy_repository_if_necessary
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment