diff --git a/Library/Homebrew/cask/lib/hbc/dsl/depends_on.rb b/Library/Homebrew/cask/lib/hbc/dsl/depends_on.rb index 2168b709000c503c8c23c6150026fa31007955f8..a8c1a1b73828474d80cb6a8d03dec071f398e9a1 100644 --- a/Library/Homebrew/cask/lib/hbc/dsl/depends_on.rb +++ b/Library/Homebrew/cask/lib/hbc/dsl/depends_on.rb @@ -13,30 +13,9 @@ module Hbc ].freeze VALID_ARCHES = { - intel: { type: :intel, bits: [32, 64] }, - ppc: { type: :ppc, bits: [32, 64] }, + intel: { type: :intel, bits: 64 }, # specific - i386: { type: :intel, bits: 32 }, x86_64: { type: :intel, bits: 64 }, - ppc_7400: { type: :ppc, bits: 32 }, - ppc_64: { type: :ppc, bits: 64 }, - }.freeze - - # Intentionally undocumented: catch variant spellings. - ARCH_SYNONYMS = { - x86_32: :i386, - x8632: :i386, - x8664: :x86_64, - intel_32: :i386, - intel32: :i386, - intel_64: :x86_64, - intel64: :x86_64, - amd_64: :x86_64, - amd64: :x86_64, - ppc7400: :ppc_7400, - ppc_32: :ppc_7400, - ppc32: :ppc_7400, - ppc64: :ppc_64, }.freeze attr_accessor :java @@ -100,8 +79,7 @@ module Hbc def arch=(*args) @arch ||= [] arches = args.map do |elt| - elt = elt.to_s.downcase.sub(/^:/, "").tr("-", "_").to_sym - ARCH_SYNONYMS.key?(elt) ? ARCH_SYNONYMS[elt] : elt + elt.to_s.downcase.sub(/^:/, "").tr("-", "_").to_sym end invalid_arches = arches - VALID_ARCHES.keys raise "invalid 'depends_on arch' values: #{invalid_arches.inspect}" unless invalid_arches.empty? diff --git a/Library/Homebrew/cask/test/cask/depends_on_test.rb b/Library/Homebrew/cask/test/cask/depends_on_test.rb index ce2e5417830df0e9261f81c07659ee06f937f9d2..4516dad37e68fb35adfed8fb058eafb650e6a4a3 100644 --- a/Library/Homebrew/cask/test/cask/depends_on_test.rb +++ b/Library/Homebrew/cask/test/cask/depends_on_test.rb @@ -79,15 +79,6 @@ describe "Satisfy Dependencies and Requirements" do Hbc::Installer.new(arch_cask).install end end - - it "raises an exception when depends_on arch is not satisfied" do - arch_cask = Hbc.load("with-depends-on-arch-failure") - lambda { - shutup do - Hbc::Installer.new(arch_cask).install - end - }.must_raise(Hbc::CaskError) - end end describe "depends_on x11" do diff --git a/Library/Homebrew/cask/test/support/Casks/with-depends-on-arch-failure.rb b/Library/Homebrew/cask/test/support/Casks/with-depends-on-arch-failure.rb deleted file mode 100644 index 14c916573578369734670901d56a0a83e5bae561..0000000000000000000000000000000000000000 --- a/Library/Homebrew/cask/test/support/Casks/with-depends-on-arch-failure.rb +++ /dev/null @@ -1,12 +0,0 @@ -test_cask 'with-depends-on-arch-failure' do - version '1.2.3' - sha256 '67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94' - - url "file://#{TEST_FIXTURE_DIR}/cask/caffeine.zip" - homepage 'http://example.com/with-depends-on-arch-failure' - - # guarantee mismatched hardware - depends_on arch: Hardware::CPU.intel? ? :ppc : :intel - - app 'Caffeine.app' -end diff --git a/Library/Homebrew/cask/test/support/Casks/with-depends-on-arch.rb b/Library/Homebrew/cask/test/support/Casks/with-depends-on-arch.rb index fe5e4ba0326d40beb6b999107d9237b98f51beba..e0c4e3fa7ce4682d609cc77b339f72b0be60b1ac 100644 --- a/Library/Homebrew/cask/test/support/Casks/with-depends-on-arch.rb +++ b/Library/Homebrew/cask/test/support/Casks/with-depends-on-arch.rb @@ -6,7 +6,7 @@ test_cask 'with-depends-on-arch' do homepage 'http://example.com/with-depends-on-arch' # covers all known hardware; always succeeds - depends_on arch: [:ppc, :intel] + depends_on arch: :intel app 'Caffeine.app' end