Better describe X11 in brew --config
This commit is contained in:
parent
4488c3546d
commit
89f86dc283
@ -52,44 +52,27 @@ module Homebrew extend self
|
|||||||
if sha.empty? then "(none)" else sha end
|
if sha.empty? then "(none)" else sha end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def describe_path path
|
||||||
|
return "N/A" if path.nil?
|
||||||
|
realpath = path.realpath
|
||||||
|
if realpath == path then path else "#{path} => #{realpath}" end
|
||||||
|
end
|
||||||
|
|
||||||
def describe_x11
|
def describe_x11
|
||||||
return "N/A" unless x11_installed?
|
return "N/A" unless MacOS.x11_installed?
|
||||||
return case x11_path = Pathname.new("/usr/X11").realpath.to_s
|
return "#{MacOS.xquartz_version} @ " + describe_path(MacOS.x11_prefix)
|
||||||
when "/usr/X11" then "/usr/X11"
|
|
||||||
else "/usr/X11 => #{x11_path}"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def describe_perl
|
def describe_perl
|
||||||
perl = which 'perl'
|
describe_path(which 'perl')
|
||||||
return "N/A" if perl.nil?
|
|
||||||
|
|
||||||
real_perl = Pathname.new(perl).realpath
|
|
||||||
return perl if perl == real_perl
|
|
||||||
return "#{perl} => #{real_perl}"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def describe_python
|
def describe_python
|
||||||
python = which 'python'
|
describe_path(which 'python')
|
||||||
return "N/A" if python.nil?
|
|
||||||
|
|
||||||
real_python = Pathname.new(python).realpath
|
|
||||||
|
|
||||||
return python if python == real_python
|
|
||||||
return "#{python} => #{real_python}"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def describe_ruby
|
def describe_ruby
|
||||||
ruby = which 'ruby'
|
describe_path(which 'ruby')
|
||||||
return "N/A" if ruby.nil?
|
|
||||||
|
|
||||||
real_ruby = Pathname.new(ruby).realpath
|
|
||||||
return ruby if ruby == real_ruby
|
|
||||||
return "#{ruby} => #{real_ruby}"
|
|
||||||
end
|
|
||||||
|
|
||||||
def real_path a_path
|
|
||||||
Pathname.new(a_path).realpath.to_s
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def hardware
|
def hardware
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user