Skip to content

Commit

Permalink
Merge pull request #7810 from rolandwalker/remove_arch_only
Browse files Browse the repository at this point in the history
DSL: remove `arch_only` caveats support
  • Loading branch information
rolandwalker committed Dec 6, 2014
2 parents 5175014 + 8170c34 commit d3e0f2b
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions lib/cask/caveats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,32 +107,6 @@ def assistive_devices
EOS
end

# minor bug: because output from arch_only is conditional, the
# existence of this directive causes "===> Caveats" header to
# appear even if no warning is output. One workaround would
# be to spin out arch-detection from caveats into a separate
# Cask stanza, and that is probably a sensible design.
def arch_only(*supported_arches)
known_arches = %w{intel-64 intel-32}
supported_arches.each do |arch|
unless known_arches.include?(arch)
raise CaskInvalidError.new(@cask, "The only valid arguments to caveats arch_only are: #{known_arches.utf8_inspect}")
end
end
this_arch = "#{Hardware::CPU.type}-#{Hardware::CPU.bits}"
unless supported_arches.include?(this_arch)
puts <<-EOS.undent
Cask #{@cask} provides binaries for these architectures: #{supported_arches.utf8_inspect}.
But you appear to be running on an unsupported architecture:
#{this_arch}
Therefore #{@cask} is not expected to work on your system.
EOS
end
end

def x11_required
unless File.exist?('/usr/X11/bin/X')
puts <<-EOS.undent
Expand Down

0 comments on commit d3e0f2b

Please sign in to comment.