Signed-off-by: Lin Jiaxin ljx.joe@qq.com --- lib/error_messages.rb | 14 +++++++------- lib/git_bisect.rb | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/error_messages.rb b/lib/error_messages.rb index 5bbc329..3e1564b 100644 --- a/lib/error_messages.rb +++ b/lib/error_messages.rb @@ -8,8 +8,8 @@ require_relative "#{ENV['LKP_SRC']}/lib/common" # usage: # foo = ErrorMessages.new(build-pkg) # build-pkg is a file that includes errors generated by make -# errorid_array = foo.obtain_error_messages_by_errorid(errorid) -# errorid_array includes all error_messages that error same as errorid +# error_id_array = foo.obtain_error_messages_by_error_id(error_id) +# error_id_array includes all error_messages that error same as error_id # error_messages_hash = foo.obtain_error_messages # error_messages_hash.each { |k,v| puts k; puts; v.each {|m| puts m } } # output: @@ -40,15 +40,15 @@ class ErrorMessages return @error_messages end
- def obtain_error_messages_by_errorid(errorid) - error_messages_by_errorid = [] + def obtain_error_messages_by_error_id(error_id) + error_messages_by_error_id = [] error_messages = obtain_error_messages error_messages.each do |k, v| - if ('build-pkg.' + build_pkg_error_id(k)) == errorid - error_messages_by_errorid += v.to_a + if ('build-pkg.' + build_pkg_error_id(k)) == error_id + error_messages_by_error_id += v.to_a end end - error_messages_by_errorid + error_messages_by_error_id end
private diff --git a/lib/git_bisect.rb b/lib/git_bisect.rb index 2043730..2fee60c 100644 --- a/lib/git_bisect.rb +++ b/lib/git_bisect.rb @@ -97,7 +97,7 @@ class GitBisect return nil unless temp[0].include?('is the first bad commit') || temp[-1].include?('bisect run success')
first_bad_commit = Utils.parse_first_bad_commit(result) - bisect_error = ErrorMessages.new(@build_pkg_dir).obtain_error_messages_by_errorid(@error_id) + bisect_error = ErrorMessages.new(@build_pkg_dir).obtain_error_messages_by_error_id(@error_id) all_errors = Utils.obt_errors(@work_dir, first_bad_commit) first_bad_commit_result_root = Utils.obt_result_root_by_commit(first_bad_commit) FileUtils.rm_r(@work_dir) if Dir.exist?(@work_dir)