Allow fetching for different arch.
This commit is contained in:
parent
c271a9ae75
commit
5e52d415a9
@ -322,29 +322,32 @@ module Cask
|
||||
|
||||
hash_keys_to_skip = %w[outdated installed versions]
|
||||
|
||||
if @dsl.on_system_blocks_exist?
|
||||
[:arm, :intel].each do |arch|
|
||||
MacOSVersions::SYMBOLS.each_key do |os_name|
|
||||
bottle_tag = ::Utils::Bottles::Tag.new(system: os_name, arch: arch)
|
||||
next unless bottle_tag.valid_combination?
|
||||
begin
|
||||
if @dsl.on_system_blocks_exist?
|
||||
[:arm, :intel].each do |arch|
|
||||
MacOSVersions::SYMBOLS.each_key do |os_name|
|
||||
bottle_tag = ::Utils::Bottles::Tag.new(system: os_name, arch: arch)
|
||||
next unless bottle_tag.valid_combination?
|
||||
|
||||
Homebrew::SimulateSystem.os = os_name
|
||||
Homebrew::SimulateSystem.arch = arch
|
||||
Homebrew::SimulateSystem.os = os_name
|
||||
Homebrew::SimulateSystem.arch = arch
|
||||
|
||||
refresh
|
||||
refresh
|
||||
|
||||
to_h.each do |key, value|
|
||||
next if hash_keys_to_skip.include? key
|
||||
next if value.to_s == hash[key].to_s
|
||||
to_h.each do |key, value|
|
||||
next if hash_keys_to_skip.include? key
|
||||
next if value.to_s == hash[key].to_s
|
||||
|
||||
variations[bottle_tag.to_sym] ||= {}
|
||||
variations[bottle_tag.to_sym][key] = value
|
||||
variations[bottle_tag.to_sym] ||= {}
|
||||
variations[bottle_tag.to_sym][key] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
ensure
|
||||
Homebrew::SimulateSystem.clear
|
||||
end
|
||||
|
||||
Homebrew::SimulateSystem.clear
|
||||
refresh
|
||||
|
||||
hash["variations"] = variations
|
||||
|
@ -20,6 +20,10 @@ module Homebrew
|
||||
Download a bottle (if available) or source packages for <formula>e
|
||||
and binaries for <cask>s. For files, also print SHA-256 checksums.
|
||||
EOS
|
||||
# This is needed for testing cask downloads on CI.
|
||||
flag "--arch=",
|
||||
description: "Download for the given arch.",
|
||||
hidden: true
|
||||
flag "--bottle-tag=",
|
||||
description: "Download a bottle for given tag."
|
||||
switch "--HEAD",
|
||||
@ -66,6 +70,10 @@ module Homebrew
|
||||
def self.fetch
|
||||
args = fetch_args.parse
|
||||
|
||||
if (arch = args.arch)
|
||||
SimulateSystem.arch = arch.to_sym
|
||||
end
|
||||
|
||||
bucket = if args.deps?
|
||||
args.named.to_formulae_and_casks.flat_map do |formula_or_cask|
|
||||
case formula_or_cask
|
||||
|
@ -144,7 +144,7 @@ module Homebrew
|
||||
|
||||
replacement_pairs << [new_hash_cask.sha256.to_s, download.sha256]
|
||||
end
|
||||
|
||||
ensure
|
||||
Homebrew::SimulateSystem.clear
|
||||
end
|
||||
elsif new_hash.present?
|
||||
|
@ -2219,34 +2219,36 @@ class Formula
|
||||
|
||||
os_versions = [*MacOSVersions::SYMBOLS.keys, :linux]
|
||||
|
||||
if path.exist? && self.class.on_system_blocks_exist?
|
||||
formula_contents = path.read
|
||||
[:arm, :intel].each do |arch|
|
||||
os_versions.each do |os_name|
|
||||
bottle_tag = Utils::Bottles::Tag.new(system: os_name, arch: arch)
|
||||
next unless bottle_tag.valid_combination?
|
||||
begin
|
||||
if path.exist? && self.class.on_system_blocks_exist?
|
||||
formula_contents = path.read
|
||||
[:arm, :intel].each do |arch|
|
||||
os_versions.each do |os_name|
|
||||
bottle_tag = Utils::Bottles::Tag.new(system: os_name, arch: arch)
|
||||
next unless bottle_tag.valid_combination?
|
||||
|
||||
Homebrew::SimulateSystem.os = os_name
|
||||
Homebrew::SimulateSystem.arch = arch
|
||||
Homebrew::SimulateSystem.os = os_name
|
||||
Homebrew::SimulateSystem.arch = arch
|
||||
|
||||
variations_namespace = Formulary.class_s("Variations#{bottle_tag.to_sym.capitalize}")
|
||||
variations_formula_class = Formulary.load_formula(name, path, formula_contents, variations_namespace,
|
||||
flags: self.class.build_flags, ignore_errors: true)
|
||||
variations_formula = variations_formula_class.new(name, path, :stable,
|
||||
alias_path: alias_path, force_bottle: force_bottle)
|
||||
variations_namespace = Formulary.class_s("Variations#{bottle_tag.to_sym.capitalize}")
|
||||
variations_formula_class = Formulary.load_formula(name, path, formula_contents, variations_namespace,
|
||||
flags: self.class.build_flags, ignore_errors: true)
|
||||
variations_formula = variations_formula_class.new(name, path, :stable,
|
||||
alias_path: alias_path, force_bottle: force_bottle)
|
||||
|
||||
variations_formula.to_hash.each do |key, value|
|
||||
next if value.to_s == hash[key].to_s
|
||||
variations_formula.to_hash.each do |key, value|
|
||||
next if value.to_s == hash[key].to_s
|
||||
|
||||
variations[bottle_tag.to_sym] ||= {}
|
||||
variations[bottle_tag.to_sym][key] = value
|
||||
variations[bottle_tag.to_sym] ||= {}
|
||||
variations[bottle_tag.to_sym][key] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
ensure
|
||||
Homebrew::SimulateSystem.clear
|
||||
end
|
||||
|
||||
Homebrew::SimulateSystem.clear
|
||||
|
||||
hash["variations"] = variations
|
||||
hash
|
||||
end
|
||||
|
@ -103,13 +103,15 @@ module Readall
|
||||
bottle_tag = Utils::Bottles::Tag.new(system: os_name, arch: arch)
|
||||
next unless bottle_tag.valid_combination?
|
||||
|
||||
Homebrew::SimulateSystem.arch = arch
|
||||
Homebrew::SimulateSystem.os = os_name
|
||||
begin
|
||||
Homebrew::SimulateSystem.arch = arch
|
||||
Homebrew::SimulateSystem.os = os_name
|
||||
|
||||
success = false unless valid_formulae?(tap.formula_files, bottle_tag: bottle_tag)
|
||||
success = false unless valid_casks?(tap.cask_files, bottle_tag: bottle_tag)
|
||||
|
||||
Homebrew::SimulateSystem.clear
|
||||
success = false unless valid_formulae?(tap.formula_files, bottle_tag: bottle_tag)
|
||||
success = false unless valid_casks?(tap.cask_files, bottle_tag: bottle_tag)
|
||||
ensure
|
||||
Homebrew::SimulateSystem.clear
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user