Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requirement tweaks #487

Merged
merged 5 commits into from
Jul 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion Library/Homebrew/requirement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def option_names

# 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

Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/requirements/osxfuse_requirement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

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
Expand Down
12 changes: 7 additions & 5 deletions Library/Homebrew/requirements/tuntap_requirement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

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