diff --git a/Library/Homebrew/hardware.rb b/Library/Homebrew/hardware.rb index 1bdfe99a78..0cbcac435f 100644 --- a/Library/Homebrew/hardware.rb +++ b/Library/Homebrew/hardware.rb @@ -80,6 +80,8 @@ module Hardware end def universal_archs + odeprecated "Hardware::CPU.universal_archs" + [arch].extend ArchitectureListExtension end diff --git a/Library/Homebrew/os/mac/architecture_list.rb b/Library/Homebrew/os/mac/architecture_list.rb index f7cca8d697..1268a7a646 100644 --- a/Library/Homebrew/os/mac/architecture_list.rb +++ b/Library/Homebrew/os/mac/architecture_list.rb @@ -1,6 +1,8 @@ # typed: false # frozen_string_literal: true +# TODO: (3.2) remove this module when the linked deprecated functions are removed. + require "hardware" module ArchitectureListExtension diff --git a/Library/Homebrew/os/mac/mach.rb b/Library/Homebrew/os/mac/mach.rb index 7a6a75c318..ff0b1c74c3 100644 --- a/Library/Homebrew/os/mac/mach.rb +++ b/Library/Homebrew/os/mac/mach.rb @@ -67,6 +67,7 @@ module MachOShim end def archs + # TODO: (3.2) remove ArchitectureListExtension mach_data.map { |m| m.fetch :arch }.extend(ArchitectureListExtension) end diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 1a22c41823..553ed7524c 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -384,6 +384,8 @@ module Kernel # Returns array of architectures that the given command or library is built for. def archs_for_command(cmd) + odeprecated "archs_for_command" + cmd = which(cmd) unless Pathname.new(cmd).absolute? Pathname.new(cmd).archs end