Signed-off-by: Lin Jiaxin ljx.joe@qq.com --- stats/build-pkg | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-)
diff --git a/stats/build-pkg b/stats/build-pkg index 9eef8c91..90f27656 100755 --- a/stats/build-pkg +++ b/stats/build-pkg @@ -1,27 +1,9 @@ #!/usr/bin/env ruby -require 'set'
-def common_error_id(line) - line = line.chomp - line = line.gsub(/\b[3-9].[0-9]+[-a-z0-9.]+/, "#") # linux version: 3.17.0-next-20141008-g099669ed - line = line.gsub(/\b[1-9][0-9]-[A-Z][a-z]+-[0-9]{4}\b/, "#") # Date: 28-Dec-2013 - line = line.gsub(/\b0x[0-9a-f]+\b/, "#") # hex number - line = line.gsub(/\b[a-f0-9]{40}\b/, "#") # SHA-1 - line = line.gsub(/\b[0-9][0-9.]*/, "#") # number - line = line.gsub(/#x\b/, "0x") - line = line.gsub(/[\"$]/, "~") - line = line.gsub(/[ \t]/, " ") - line = line.gsub(/\ \ +/, " ") - line = line.gsub(/([^a-zA-Z0-9])\ /, "\1") - line = line.gsub(/\ ([^a-zA-Z])/, "\1") - line = line.gsub(/^\ /, "") - line = line.gsub(/^-/, "") - line = line.gsub(/\ _/, "_") - line = line.tr(" ", "-") - line = line.gsub(/[-_.,;:#![(]+$/, "") - line = line.gsub(/([-_.,;:#!]){3,}/, ":") - line -end +LKP_SRC = ENV['LKP_SRC'] || File.dirname(File.dirname(File.realpath($PROGRAM_NAME))) + +require 'set' +require "#{LKP_SRC}/lib/common"
error_ids = Set.new in_stderr = false @@ -40,7 +22,7 @@ while (line = STDIN.gets) next unless in_stderr next unless line.downcase =~ /error|warning/
- error_ids << common_error_id(line) + error_ids << build_pkg_error_id(line) end
error_ids.each do |id|