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

Suppress lspci and ldconfig errors unless in debug mode #129

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/mittsu/renderers/generic_lib.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'open3'

module Mittsu
module GenericLib
def discover
Expand Down Expand Up @@ -32,7 +34,8 @@ def file

class << self
def kernel_module_in_use
lspci_line = `lspci -nnk | grep -i vga -A3 | grep 'in use'`
lspci_line, stderr, _status = Open3.capture3("lspci -nnk | grep -i vga -A3 | grep 'in use'")
puts stderr if DEBUG
/in use:\s*(\S+)/ =~ lspci_line && $1
rescue
''
Expand Down
4 changes: 3 additions & 1 deletion lib/mittsu/renderers/glfw_lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def libgl_paths
end

def ldconfig
`ldconfig -p | grep 'libglfw3\\?\\.so'`.lines
out, stderr, _status = Open3.capture3("ldconfig -p | grep 'libglfw3\\?\\.so'")
puts stderr if DEBUG
out.lines
rescue
[]
end
Expand Down