dev-cmd/unbottled: simulate target tag

This commit is contained in:
Bo Anderson 2022-11-15 05:22:42 +00:00
parent b7391069d4
commit bca9eb05d1
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65
2 changed files with 17 additions and 5 deletions

View File

@ -44,6 +44,15 @@ module Homebrew
Utils::Bottles.tag
end
Homebrew::SimulateSystem.os = @bottle_tag.system
Homebrew::SimulateSystem.arch = if Hardware::CPU::INTEL_ARCHS.include?(@bottle_tag.arch)
:intel
elsif Hardware::CPU::ARM_ARCHS.include?(@bottle_tag.arch)
:arm
else
raise "Unknown arch #{@bottle_tag.arch}."
end
all = args.eval_all?
if args.total?
if !all && !Homebrew::EnvConfig.eval_all?
@ -82,6 +91,8 @@ module Homebrew
end
output_unbottled(formulae, deps_hash, noun, hash, args.named.present?)
ensure
Homebrew::SimulateSystem.clear
end
def formulae_all_installs_from_args(args, all)

View File

@ -9,15 +9,16 @@ module Hardware
class CPU
INTEL_32BIT_ARCHS = [:i386].freeze
INTEL_64BIT_ARCHS = [:x86_64].freeze
INTEL_ARCHS = (INTEL_32BIT_ARCHS + INTEL_64BIT_ARCHS).freeze
PPC_32BIT_ARCHS = [:ppc, :ppc32, :ppc7400, :ppc7450, :ppc970].freeze
PPC_64BIT_ARCHS = [:ppc64, :ppc64le, :ppc970].freeze
PPC_ARCHS = (PPC_32BIT_ARCHS + PPC_64BIT_ARCHS).freeze
ARM_64BIT_ARCHS = [:arm64, :aarch64].freeze
ARM_ARCHS = ARM_64BIT_ARCHS
ALL_ARCHS = [
*INTEL_32BIT_ARCHS,
*INTEL_64BIT_ARCHS,
*PPC_32BIT_ARCHS,
*PPC_64BIT_ARCHS,
*ARM_64BIT_ARCHS,
*INTEL_ARCHS,
*PPC_ARCHS,
*ARM_ARCHS,
].freeze
INTEL_64BIT_OLDEST_CPU = :core2