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