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 debug = 09 }11 debug!=0 { print "# " $0 }13 /^$/ { next }15 /^echo cd / { next }16 /^\+\+ pwd/ { next }18 /^\* /{19 if(debug) print "% mark"20 print >out21 fflush(out)22 cmd = ""23 printtabs = 1 # print indented lines immediately following24 errors = 025 next26 }28 /^ / && printtabs!=0 {29 print >out30 fflush(out)31 next32 }34 { printtabs = 0 }36 /^(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)($|[^:])/ {37 if(debug) print "% start"38 errors = 039 cmd = ""40 if(!verbose)41 cmd = cmd cd42 cmd = cmd $0 "\n"43 next44 }46 /^cd / {47 if(debug) print "% cd"48 errors = 049 if(verbose){50 print >out51 fflush(out)52 }53 cd = $0 "\n"54 cmd = ""55 next56 }58 {59 cmd = cmd $0 "\n"60 }62 errors != 0 {63 if(debug) print "% errors"64 printf "%s", cmd >out65 fflush(out)66 cmd = ""67 next68 }70 /^( |then|else|fi|done|[ar] - [^ ]*\.o$)/ {71 next72 }74 /^(conflicts:)/ {75 if(debug) print "% skip1"76 next77 }79 /(up to date|nothing to see|assuming it will be|loop not entered)/ {80 next81 }83 /(nodes\(%e\)|packed transitions)/ {84 if(debug) print "% skip2"85 next86 }88 {89 # unexpected line90 if(debug) print "% errors1"91 errors = 192 printf ">>> %s", cmd >out93 fflush(out)94 cmd = ""95 }