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 /^echo cd / { next }
15 /^\+\+ pwd/ { next }
17 /^\* /{
18 if(debug) print "% mark"
19 print >out
20 fflush(out)
21 cmd = ""
22 printtabs = 1 # print indented lines immediately following
23 errors = 0
24 next
25 }
27 /^ / && printtabs {
28 print >out
29 fflush(out)
30 next
31 }
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 = 0
38 cmd = ""
39 if(!verbose)
40 cmd = cmd cd
41 cmd = cmd $0 "\n"
42 next
43 }
45 /^cd / {
46 if(debug) print "% cd"
47 errors = 0
48 if(verbose){
49 print >out
50 fflush(out)
51 }
52 cd = $0 "\n"
53 cmd = ""
54 next
55 }
57 {
58 cmd = cmd $0 "\n"
59 }
61 errors {
62 if(debug) print "% errors"
63 printf "%s", cmd >out
64 fflush(out)
65 cmd = ""
66 next
67 }
69 /^( |then|else|fi|done|[ar] - [^ ]*\.o$)/ {
70 next
71 }
73 /^(up to date|nothing to see|assuming it will be|loop not entered|conflicts:)/ {
74 if(debug) print "% skip1"
75 next
76 }
78 /is up to date/ {
79 next
80 }
82 /(nodes\(%e\)|packed transitions)/ {
83 if(debug) print "% skip2"
84 next
85 }
87 {
88 # unexpected line
89 if(debug) print "% errors1"
90 errors = 1
91 printf ">>> %s", cmd >out
92 fflush(out)
93 cmd = ""
94 }