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.
|
# The message to show when the requirement is not met.
|
||||||
def message
|
def message
|
||||||
s = ""
|
_, _, class_name = self.class.to_s.rpartition "::"
|
||||||
|
s = "#{class_name} unsatisfied!\n"
|
||||||
if cask
|
if cask
|
||||||
s += <<-EOS.undent
|
s += <<-EOS.undent
|
||||||
|
|
||||||
|
|||||||
@ -2,14 +2,14 @@ require "requirement"
|
|||||||
|
|
||||||
class OsxfuseRequirement < Requirement
|
class OsxfuseRequirement < Requirement
|
||||||
fatal true
|
fatal true
|
||||||
default_formula "osxfuse"
|
|
||||||
cask "osxfuse"
|
cask "osxfuse"
|
||||||
download "https://osxfuse.github.io/"
|
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?
|
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
|
end
|
||||||
|
|
||||||
env do
|
env do
|
||||||
|
|||||||
@ -2,13 +2,15 @@ require "requirement"
|
|||||||
|
|
||||||
class TuntapRequirement < Requirement
|
class TuntapRequirement < Requirement
|
||||||
fatal true
|
fatal true
|
||||||
default_formula "tuntap"
|
|
||||||
cask "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?
|
def self.binary_tuntap_installed?
|
||||||
File.exist?("/Library/Extensions/tun.kext") && File.exist?("/Library/Extensions/tap.kext")
|
%w[
|
||||||
File.exist?("/Library/LaunchDaemons/net.sf.tuntaposx.tun.plist")
|
/Library/Extensions/tun.kext
|
||||||
File.exist?("/Library/LaunchDaemons/net.sf.tuntaposx.tap.plist")
|
/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
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user