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 /^\* /{15 if(debug) print "% mark"16 print >out17 fflush(out)18 cmd = ""19 printtabs = 1 # print indented lines immediately following20 errors = 021 next22 }24 /^ / && printtabs {25 print >out26 fflush(out)27 next28 }30 { printtabs = 0 }32 /^(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)($|[^:])/ {33 if(debug) print "% start"34 errors = 035 cmd = ""36 if(!verbose)37 cmd = cmd cd38 cmd = cmd $0 "\n"39 next40 }42 /^cd / {43 if(debug) print "% cd"44 errors = 045 if(verbose){46 print >out47 fflush(out)48 }49 cd = $0 "\n"50 cmd = ""51 next52 }54 {55 cmd = cmd $0 "\n"56 }58 errors {59 if(debug) print "% errors"60 printf "%s", cmd >out61 fflush(out)62 cmd = ""63 next64 }66 /^( |then|else|fi|done|[ar] - [^ ]*\.o$)/ {67 next68 }70 /^(up to date|nothing to see|assuming it will be|loop not entered|conflicts:)/ {71 if(debug) print "% skip1"72 next73 }75 /is up to date/ {76 next77 }79 /(nodes\(%e\)|packed transitions)/ {80 if(debug) print "% skip2"81 next82 }84 {85 # unexpected line86 if(debug) print "% errors1"87 errors = 188 printf ">>> %s", cmd >out89 fflush(out)90 cmd = ""91 }