From b670ab1c7b1bf3a2edecbbe0e12f8ab5b86732af Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Tue, 2 Feb 2021 16:19:24 +0000 Subject: [PATCH] Deprecate additional arch functions --- Library/Homebrew/hardware.rb | 2 ++ Library/Homebrew/os/mac/architecture_list.rb | 2 ++ Library/Homebrew/os/mac/mach.rb | 1 + Library/Homebrew/utils.rb | 2 ++ 4 files changed, 7 insertions(+) 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