aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2016-09-20 09:07:02 +0100
committerMike McQuaid2016-09-20 09:07:02 +0100
commit2ecd73bca4cee61096e076e7c15fd6e8ae928d6d (patch)
tree75aa488d133ca5e6871cb973337e73ed47c62ad1
parentd9023a65f09498cfe1cc57cdb673e96fc48f0ff6 (diff)
downloadbrew-2ecd73bca4cee61096e076e7c15fd6e8ae928d6d.tar.bz2
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.
-rw-r--r--Library/Homebrew/brew.sh3
-rw-r--r--Library/Homebrew/cmd/update-report.rb3
2 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh
index daf53823f..fc2e6993c 100644
--- a/Library/Homebrew/brew.sh
+++ b/Library/Homebrew/brew.sh
@@ -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
diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb
index 1d58018b3..b096dfc3b 100644
--- a/Library/Homebrew/cmd/update-report.rb
+++ b/Library/Homebrew/cmd/update-report.rb
@@ -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