Merge pull request #487 from MikeMcQuaid/requirement-tweaks
Requirement tweaks
This commit is contained in:
commit
4a73249406
@ -31,7 +31,8 @@ class Requirement
|
||||
|
||||
# The message to show when the requirement is not met.
|
||||
def message
|
||||
s = ""
|
||||
_, _, class_name = self.class.to_s.rpartition "::"
|
||||
s = "#{class_name} unsatisfied!\n"
|
||||
if cask
|
||||
s += <<-EOS.undent
|
||||
|
||||
|
||||
@ -2,14 +2,14 @@ require "requirement"
|
||||
|
||||
class OsxfuseRequirement < Requirement
|
||||
fatal true
|
||||
default_formula "osxfuse"
|
||||
cask "osxfuse"
|
||||
download "https://osxfuse.github.io/"
|
||||
|
||||
satisfy(:build_env => false) { Formula["osxfuse"].installed? || self.class.binary_osxfuse_installed? }
|
||||
satisfy(:build_env => false) { self.class.binary_osxfuse_installed? }
|
||||
|
||||
def self.binary_osxfuse_installed?
|
||||
File.exist?("/usr/local/include/osxfuse/fuse.h") && !File.symlink?("/usr/local/include/osxfuse")
|
||||
File.exist?("/usr/local/include/osxfuse/fuse.h") &&
|
||||
!File.symlink?("/usr/local/include/osxfuse")
|
||||
end
|
||||
|
||||
env do
|
||||
|
||||
@ -2,13 +2,15 @@ require "requirement"
|
||||
|
||||
class TuntapRequirement < Requirement
|
||||
fatal true
|
||||
default_formula "tuntap"
|
||||
cask "tuntap"
|
||||
satisfy(:build_env => false) { self.class.binary_tuntap_installed? || Formula["tuntap"].installed? }
|
||||
satisfy(:build_env => false) { self.class.binary_tuntap_installed? }
|
||||
|
||||
def self.binary_tuntap_installed?
|
||||
File.exist?("/Library/Extensions/tun.kext") && File.exist?("/Library/Extensions/tap.kext")
|
||||
File.exist?("/Library/LaunchDaemons/net.sf.tuntaposx.tun.plist")
|
||||
File.exist?("/Library/LaunchDaemons/net.sf.tuntaposx.tap.plist")
|
||||
%w[
|
||||
/Library/Extensions/tun.kext
|
||||
/Library/Extensions/tap.kext
|
||||
/Library/LaunchDaemons/net.sf.tuntaposx.tun.plist
|
||||
/Library/LaunchDaemons/net.sf.tuntaposx.tap.plist
|
||||
].all? { |file| File.exist?(file) }
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user