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