X Tutup
Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit d32d78d

Browse files
committed
various: add remote migration hack
Depends on what local revision users start with, there will be several places which can be used to trigger remote migrations. * `tap_migrations`: some old system will load `tap_migrations` during `brew update` * `formula_revision`: old system whose revision is after c010cc8 but before ac5707c will load `formula_revision` during `brew update`. This will help to solve #42553 on these systems * `update-reporter`: system since we implement bash update script. Closes #50653. Signed-off-by: Xu Cheng <xucheng@me.com>
1 parent 5f53fc3 commit d32d78d

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

Library/Homebrew/cmd/update-report.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This is a hack to force old Homebrew to perform core/formula separation migration.
2+
require "migrate_remote"
3+
14
require "formula_versions"
25
require "migrator"
36
require "formulary"

Library/Homebrew/formula_versions.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
require "formula"
2+
# This is a hack to force old Homebrew to perform core/formula separation migration.
3+
# On some old system, `brew update` will try to load `formula_versions.rb` file.
4+
require "migrate_remote"
25

36
class FormulaVersions
47
IGNORED_EXCEPTIONS = [

Library/Homebrew/migrate_remote.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
def migrate_remote!
3+
# only perform the migration when invoked by update.rb or update-report.rb
4+
return unless Kernel.caller.any? { |f| f.include?("update") }
5+
oh1 "Migrating Homebrew to v0.9.9"
6+
exec HOMEBREW_BREW_FILE, "update"
7+
end
8+
9+
migrate_remote!

Library/Homebrew/tap_migrations.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# This is a hack to force old Homebrew to perform core/formula separation migration.
2+
# On some old system, `brew update` will try to load `tap_migrations.rb` file.
3+
require "migrate_remote"
4+
15
TAP_MIGRATIONS = {
26
"adobe-air-sdk" => "homebrew/binary",
37
"afuse" => "homebrew/fuse",

0 commit comments

Comments
 (0)
X Tutup