class RBT::NotFoundLibraries
Constants
- NOT_FOUND_STRING
#¶ ↑
NOT_FOUND_STRING
¶ ↑#¶ ↑
Public Class Methods
[](i = ARGV)
click to toggle source
new( commandline_arguments = nil, run_already = true )
click to toggle source
Public Instance Methods
determine_all_binaries_on_this_system()
click to toggle source
#¶ ↑
determine_all_binaries_on_this_system
¶ ↑
Determine which .sp files exist on this system.
#¶ ↑
# File lib/rbt/utility_scripts/not_found_libraries.rb, line 76 def determine_all_binaries_on_this_system @all_shared_object_libaries = [] @search_through_these_directories.each {|this_directory| @all_shared_object_libaries << Dir["#{this_directory}*"] } @all_shared_object_libaries.flatten! @all_shared_object_libaries.uniq! @all_shared_object_libaries.select! {|entry| File.exist? entry } end
hash_these_entries_are_missing?()
click to toggle source
#¶ ↑
hash_these_entries_are_missing?¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/not_found_libraries.rb, line 171 def hash_these_entries_are_missing? @hash_these_entries_are_missing end
Also aliased as: dataset?
notify_the_user_what_will_be_done_next()
click to toggle source
report_whether_entries_are_missing_and_which_ones_are_missing()
click to toggle source
#¶ ↑
report_whether_entries_are_missing_and_which_ones_are_missing
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/not_found_libraries.rb, line 178 def report_whether_entries_are_missing_and_which_ones_are_missing _ = @hash_these_entries_are_missing if _.empty? opne 'No shared-object library appears to be missing. '\ 'This is good. '+gold('\o/') e opne 'The following directories were searched:' show_the_directories_that_will_be_searched else opne "These entries appear to be #{orange('missing')}:" _.each {|this_library_is_missing, array_these_binaries_have_problems| e 'The following binaries refer to this missing .so library: '+orange( File.basename(this_library_is_missing) ) array_these_binaries_have_problems.each {|this_binary_has_a_problem| e royalblue(' '+this_binary_has_a_problem) } } save_the_hash_into_a_yaml_file end end
Also aliased as: report
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/utility_scripts/not_found_libraries.rb, line 49 def reset super() infer_the_namespace # ======================================================================= # # === @hash_these_entries_are_missing # # The next Hash is our main data-structure for this class. # ======================================================================= # @hash_these_entries_are_missing = {} @hash_these_entries_are_missing.default = [] # ======================================================================= # # === @search_through_these_directories # ======================================================================= # @search_through_these_directories = %w( /bin/ /sbin/ /usr/bin/ /usr/local/bin/ /System/Index/bin/ ) end
run()
click to toggle source
run_ldd_on_each_discovered_binary()
click to toggle source
#¶ ↑
run_ldd_on_each_discovered_binary
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/not_found_libraries.rb, line 89 def run_ldd_on_each_discovered_binary @all_shared_object_libaries.each {|this_file| result = `ldd #{this_file} 2>&1` if result.include? NOT_FOUND_STRING matches = result.split("\n").select {|inner_entry| inner_entry.include? NOT_FOUND_STRING } these_matches_are_available = matches.map {|most_inner_entry| most_inner_entry.sub(/\t/,'') } these_matches_are_available.each {|match| # ================================================================= # # Must eliminate a part of this: # ================================================================= # match.sub!(/ => not found/,'') unless @hash_these_entries_are_missing.has_key? match @hash_these_entries_are_missing[match] = [] end @hash_these_entries_are_missing[match] << this_file @hash_these_entries_are_missing[match].uniq! } end } end
save_the_hash_into_a_yaml_file()
click to toggle source
#¶ ↑
save_the_hash_into_a_yaml_file
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/not_found_libraries.rb, line 203 def save_the_hash_into_a_yaml_file what = YAML.dump(@hash_these_entries_are_missing) into = "#{rbt_log_dir?}missing_libraries.yml" opne "Also keeping a log of these files into `#{sfile(into)}`." write_what_into(what, into) end
show_help()
click to toggle source
show_the_directories_that_will_be_searched()
click to toggle source