Blob
1 # Summarize the installation log, printing errors along with2 # enough context to make sense of them.4 BEGIN {5 # print verbose6 cd = ""7 out = "/dev/stdout";8 }10 debug { print "# " $0 }12 /^$/ { next }14 /^echo cd / { next }15 /^\+\+ pwd/ { next }17 /^\* /{18 if(debug) print "% mark"19 print >out20 fflush(out)21 cmd = ""22 printtabs = 1 # print indented lines immediately following23 errors = 024 next25 }27 /^ / && printtabs {28 print >out29 fflush(out)30 next31 }33 { printtabs = 0 }35 /^(9a|9c|9l|9ar|9?install|cp|rm|mv|mk|9 yacc|9 lex|9 rc|do|for i|if|mk|gcc|cpp|cp|sh|cmp|rc|\.\/o)($|[^:])/ {36 if(debug) print "% start"37 errors = 038 cmd = ""39 if(!verbose)40 cmd = cmd cd41 cmd = cmd $0 "\n"42 next43 }45 /^cd / {46 if(debug) print "% cd"47 errors = 048 if(verbose){49 print >out50 fflush(out)51 }52 cd = $0 "\n"53 cmd = ""54 next55 }57 {58 cmd = cmd $0 "\n"59 }61 errors {62 if(debug) print "% errors"63 printf "%s", cmd >out64 fflush(out)65 cmd = ""66 next67 }69 /^( |then|else|fi|done|[ar] - [^ ]*\.o$)/ {70 next71 }73 /^(up to date|nothing to see|assuming it will be|loop not entered|conflicts:)/ {74 if(debug) print "% skip1"75 next76 }78 /is up to date/ {79 next80 }82 /(nodes\(%e\)|packed transitions)/ {83 if(debug) print "% skip2"84 next85 }87 {88 # unexpected line89 if(debug) print "% errors1"90 errors = 191 printf ">>> %s", cmd >out92 fflush(out)93 cmd = ""94 }