class RBT::ConfigLogParser
Constants
- CHROOT_TARGET
#¶ ↑
CHROOT_TARGET
¶ ↑#¶ ↑
- REGEX_FOR_MISSING_HEADER_FILES
#¶ ↑
RBT::ConfigLogParser::REGEX_FOR_MISSING_HEADER_FILES
¶ ↑#¶ ↑
- THIS_FILE
#¶ ↑
THIS_FILE
¶ ↑#¶ ↑
- TRY_TO_AUTOCORRECT_HEADER_FILES
#¶ ↑
TRY_TO_AUTOCORRECT_HEADER_FILES
¶ ↑If the following constant is set to true, then we will attempt to copy missing .h files into the /Depot/Chroot/usr/include/ hierarchy.
#¶ ↑
- USR_INCLUDE
#¶ ↑
USR_INCLUDE
¶ ↑#¶ ↑
Public Class Methods
[](i = ARGV)
click to toggle source
Public Instance Methods
consider_copying_this_header_file( i = missing_header_files? )
click to toggle source
#¶ ↑
consider_copying_this_header_file
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/config_log_parser.rb, line 162 def consider_copying_this_header_file( i = missing_header_files? ) if i.is_a? Array i.each {|entry| consider_copying_this_header_file(entry) } else if TRY_TO_AUTOCORRECT_HEADER_FILES regex = REGEX_FOR_MISSING_HEADER_FILES i =~ regex target = $1.to_s.dup from = "#{USR_INCLUDE}#{target}" to = (CHROOT_TARGET+USR_INCLUDE+target).squeeze('/') unless File.exist? to if File.exist? from e "Trying to autocorrect this error next. "\ "(From: #{sfile(from)} | To: #{sfile(to)})" copy_file(from, to, :be_verbose) else no_file_exists_at(from) end end end end end
missing_header_files?()
click to toggle source
report_results()
click to toggle source
#¶ ↑
report_results
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/config_log_parser.rb, line 202 def report_results # ======================================================================= # # First, check whether there are any missing header files. # ======================================================================= # unless @missing_header_files.empty? e rev+'These '+royalblue('header files')+' are missing:'; e @missing_header_files.each {|file| e " #{sfile(file)}" consider_copying_this_header_file(file) }; e end # ======================================================================= # # === Report missing shared libraries next: # ======================================================================= # unless @missing_shared_libraries.empty? e rev+'These '+royalblue('shared libraries')+' appear to be missing:' e @missing_shared_libraries.each {|file| e ' '+sfile(file) # consider_copying_this_header_file(file) }; e 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/config_log_parser.rb, line 77 def reset super() infer_the_namespace # ======================================================================= # # === @dataset # ======================================================================= # @dataset = nil # ======================================================================= # # === @missing_header_files # ======================================================================= # @missing_header_files = [] # Keep track of missing .h files. # ======================================================================= # # === @missing_shared_libraries # ======================================================================= # @missing_shared_libraries = [] end
run()
click to toggle source
#¶ ↑
run (run tag)¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/config_log_parser.rb, line 229 def run opnn { :no_trailing } e e _ = @this_file if _.nil? # ===================================================================== # # This, for now, can only happen if you input the instruction # :do_not_use_any_input_file is used. For now we do absolutely # nothing in this case. # ===================================================================== # else if File.exist? _ # The file is 'config.log' @dataset = File.readlines(_) # =================================================================== # # Ok, now we have the full dataset. # First, we scan for missing header files. # =================================================================== # scan_for_missing_header_files # =================================================================== # # Then we scan for missing shared libraries. # =================================================================== # scan_for_missing_shared_libraries scan_for_erroneous_assembler_messages else no_file_exists_at(_) end report_results end end
scan_for_erroneous_assembler_messages()
click to toggle source
#¶ ↑
scan_for_erroneous_assembler_messages
¶ ↑
These assembler-messages are typically generated by binutils.
#¶ ↑
# File lib/rbt/utility_scripts/config_log_parser.rb, line 192 def scan_for_erroneous_assembler_messages if @dataset.any? {|line| line.include? '.s: Assembler messages:' } e 'Some problem with Assembler-messages ('+ steelblue('binutils')+')' end end
scan_for_missing_header_files()
click to toggle source
#¶ ↑
scan_for_missing_header_files
¶ ↑
This method will scan for missing .h files.
#¶ ↑
# File lib/rbt/utility_scripts/config_log_parser.rb, line 123 def scan_for_missing_header_files set_missing_header_files @dataset.select {|line| # ===================================================================== # # The next line is valid for entries such as: # include/stdio.h:164:10: fatal error: bits/stdio_lim.h: No such file or directory # ===================================================================== # line.include?('.h') and line.include?('fatal error:') and line.include?('No such file or directory') } end
set_missing_header_files(i)
click to toggle source
set_this_file( i = THIS_FILE )
click to toggle source