Skip to content

Commit

Permalink
suppress lspci and ldconfig errors unless in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Nov 12, 2024
1 parent c59c4f3 commit 6dad8f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit 6dad8f4

Please sign in to comment.