Blob


1 # Summarize the installation log, printing errors along with
2 # enough context to make sense of them.
4 BEGIN {
5 # print verbose
6 cd = ""
7 out = "/dev/stdout";
8 }
10 debug { print "# " $0 }
12 /^$/ { next }
14 /^\* /{
15 if(debug) print "% mark"
16 print >out
17 fflush(out)
18 cmd = ""
19 printtabs = 1 # print indented lines immediately following
20 errors = 0
21 next
22 }
24 /^ / && printtabs {
25 print >out
26 fflush(out)
27 next
28 }
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 = 0
35 cmd = ""
36 if(!verbose)
37 cmd = cmd cd
38 cmd = cmd $0 "\n"
39 next
40 }
42 /^cd / {
43 if(debug) print "% cd"
44 errors = 0
45 if(verbose){
46 print >out
47 fflush(out)
48 }
49 cd = $0 "\n"
50 cmd = ""
51 next
52 }
54 {
55 cmd = cmd $0 "\n"
56 }
58 errors {
59 if(debug) print "% errors"
60 printf "%s", cmd >out
61 fflush(out)
62 cmd = ""
63 next
64 }
66 /^( |then|else|fi|done|[ar] - [^ ]*\.o$)/ {
67 next
68 }
70 /^(up to date|nothing to see|assuming it will be|loop not entered|conflicts:)/ {
71 if(debug) print "% skip1"
72 next
73 }
75 /is up to date/ {
76 next
77 }
79 /(nodes\(%e\)|packed transitions)/ {
80 if(debug) print "% skip2"
81 next
82 }
84 {
85 # unexpected line
86 if(debug) print "% errors1"
87 errors = 1
88 printf ">>> %s", cmd >out
89 fflush(out)
90 cmd = ""
91 }