Class: Bwrap::Resolvers::Library::Musl Private

Inherits:
Base
  • Object
show all
Defined in:
lib/bwrap/resolvers/library/musl.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Used via Bwrap::Resolvers::Library.

Instance Method Summary collapse

Methods included from Output

debug?, debug_output, error_output, handle_output_options, info_output, quiet?, trace?, trace_output, verb_output, verbose?, warn_output

Methods included from Execution

do_execute, last_status, popen2e

Instance Method Details

#needed_libraries(binary_paths) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • binary_paths (String, Array)

    one or more paths to be resolved



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/bwrap/resolvers/library/musl.rb', line 10

def needed_libraries binary_paths
  trace "Finding musl libraries #{binary_paths} requires"
  @needed_libraries = []

  binary_paths = convert_binary_paths binary_paths

  # Check if the exe is already resolved.
  binary_paths.delete_if do |binary_path|
    Bwrap::Resolvers::Library.needed_libraries_cache.include? binary_path
  end

  return [] if binary_paths.empty?

  binary_paths.each do |binary_path|
    output = execvalue %W{ ldd #{binary_path} }
    lines = output.split "\n"
    _interpreter_line = lines.shift

    lines.each do |line|
      parse_ldd_line line
    end
  end

  @needed_libraries
end