2005-11-26 15:36:47 +00:00
|
|
|
# Summarize the installation log, printing errors along with
|
|
|
|
# enough context to make sense of them.
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
# print verbose
|
|
|
|
cd = ""
|
2005-12-15 03:31:07 +00:00
|
|
|
out = "/dev/stdout"
|
2006-07-23 14:36:05 +00:00
|
|
|
statuslen = 0
|
2005-12-15 03:31:07 +00:00
|
|
|
debug = 0
|
2006-07-23 14:36:05 +00:00
|
|
|
updates = "/dev/stderr"
|
2012-10-20 17:41:25 +00:00
|
|
|
if(ENVIRON["winid"] != "") # running in acme window
|
|
|
|
updates = ""
|
2006-07-23 14:36:05 +00:00
|
|
|
}
|
|
|
|
|
2008-12-06 23:45:15 +00:00
|
|
|
function myflush(f)
|
2008-12-01 23:56:46 +00:00
|
|
|
{
|
2008-12-06 23:45:15 +00:00
|
|
|
# fflush is not available on sun, but system("") appears to work everywhere
|
2008-12-01 23:56:46 +00:00
|
|
|
system("")
|
|
|
|
}
|
|
|
|
|
|
|
|
function clearstatus(noflush, i)
|
2006-07-23 14:36:05 +00:00
|
|
|
{
|
|
|
|
if(!updates)
|
|
|
|
return
|
|
|
|
for(i=0; i<statuslen; i++)
|
|
|
|
printf("\b \b") >updates
|
|
|
|
statuslen = 0
|
2006-07-23 14:41:55 +00:00
|
|
|
if(!noflush)
|
2008-12-06 23:45:15 +00:00
|
|
|
myflush(updates)
|
2006-07-23 14:36:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function status(s)
|
|
|
|
{
|
|
|
|
if(!updates)
|
|
|
|
return
|
2006-07-23 14:41:55 +00:00
|
|
|
clearstatus(1)
|
2006-07-23 14:36:05 +00:00
|
|
|
printf(" %s ", s) >updates
|
|
|
|
statuslen = length(s)+5
|
2008-12-06 23:45:15 +00:00
|
|
|
myflush(updates)
|
2005-11-26 15:36:47 +00:00
|
|
|
}
|
|
|
|
|
2005-12-15 03:31:07 +00:00
|
|
|
debug!=0 { print "# " $0 }
|
2005-11-26 15:36:47 +00:00
|
|
|
|
|
|
|
/^$/ { next }
|
|
|
|
|
2005-11-28 21:14:44 +00:00
|
|
|
/^echo cd / { next }
|
|
|
|
/^\+\+ pwd/ { next }
|
|
|
|
|
2005-11-26 15:36:47 +00:00
|
|
|
/^\* /{
|
2006-07-23 14:36:05 +00:00
|
|
|
clearstatus()
|
2005-11-26 15:36:47 +00:00
|
|
|
if(debug) print "% mark"
|
|
|
|
print >out
|
2008-12-06 23:45:15 +00:00
|
|
|
myflush(out)
|
2006-07-23 14:36:05 +00:00
|
|
|
if(copy){
|
|
|
|
print >copy
|
2008-12-06 23:45:15 +00:00
|
|
|
myflush(copy)
|
2006-07-23 14:36:05 +00:00
|
|
|
}
|
2005-11-26 15:36:47 +00:00
|
|
|
cmd = ""
|
|
|
|
printtabs = 1 # print indented lines immediately following
|
|
|
|
errors = 0
|
|
|
|
next
|
|
|
|
}
|
|
|
|
|
2005-12-15 03:31:07 +00:00
|
|
|
/^ / && printtabs!=0 {
|
2006-07-23 14:36:05 +00:00
|
|
|
clearstatus()
|
2005-11-26 15:36:47 +00:00
|
|
|
print >out
|
2008-12-06 23:45:15 +00:00
|
|
|
myflush(out)
|
2006-07-23 14:36:05 +00:00
|
|
|
if(copy){
|
|
|
|
print >copy
|
2008-12-06 23:45:15 +00:00
|
|
|
myflush(copy)
|
2006-07-23 14:36:05 +00:00
|
|
|
}
|
2005-11-26 15:36:47 +00:00
|
|
|
next
|
|
|
|
}
|
|
|
|
|
|
|
|
{ printtabs = 0 }
|
|
|
|
|
2008-05-10 17:34:45 +00:00
|
|
|
/^(9a|9c|9l|9ar|9?install|cat pdf|cp|rm|mv|mk|9 yacc|9 lex|9 rc|do|for i|if|mk|gcc|cpp|cp|sh|cmp|rc|\.\/o)($|[^:])/ {
|
2005-11-26 15:36:47 +00:00
|
|
|
if(debug) print "% start"
|
|
|
|
errors = 0
|
|
|
|
cmd = ""
|
|
|
|
if(!verbose)
|
|
|
|
cmd = cmd cd
|
|
|
|
cmd = cmd $0 "\n"
|
|
|
|
next
|
|
|
|
}
|
|
|
|
|
2006-07-23 14:41:55 +00:00
|
|
|
/^cd .+; mk .+/ && !verbose {
|
|
|
|
dir = $2
|
|
|
|
sub(/;$/, "", dir)
|
|
|
|
status(dir " mk " $4)
|
|
|
|
}
|
|
|
|
|
2005-11-26 15:36:47 +00:00
|
|
|
/^cd / {
|
|
|
|
if(debug) print "% cd"
|
|
|
|
errors = 0
|
|
|
|
if(verbose){
|
|
|
|
print >out
|
2008-12-06 23:45:15 +00:00
|
|
|
myflush(out)
|
2006-07-23 14:36:05 +00:00
|
|
|
if(copy){
|
|
|
|
print >copy
|
2008-12-06 23:45:15 +00:00
|
|
|
myflush(copy)
|
2006-07-23 14:36:05 +00:00
|
|
|
}
|
|
|
|
}
|
2005-11-26 15:36:47 +00:00
|
|
|
cd = $0 "\n"
|
|
|
|
cmd = ""
|
|
|
|
next
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
cmd = cmd $0 "\n"
|
|
|
|
}
|
|
|
|
|
2005-12-15 03:31:07 +00:00
|
|
|
errors != 0 {
|
2006-07-23 14:36:05 +00:00
|
|
|
clearstatus()
|
2005-11-26 15:36:47 +00:00
|
|
|
if(debug) print "% errors"
|
|
|
|
printf "%s", cmd >out
|
2008-12-06 23:45:15 +00:00
|
|
|
myflush(out)
|
2006-07-23 14:36:05 +00:00
|
|
|
if(copy){
|
|
|
|
printf "%s", cmd >copy
|
2008-12-06 23:45:15 +00:00
|
|
|
myflush(copy)
|
2006-07-23 14:36:05 +00:00
|
|
|
}
|
2005-11-26 15:36:47 +00:00
|
|
|
cmd = ""
|
|
|
|
next
|
|
|
|
}
|
|
|
|
|
|
|
|
/^( |then|else|fi|done|[ar] - [^ ]*\.o$)/ {
|
|
|
|
next
|
|
|
|
}
|
|
|
|
|
2005-12-15 03:31:07 +00:00
|
|
|
/^(conflicts:)/ {
|
2005-11-26 15:36:47 +00:00
|
|
|
if(debug) print "% skip1"
|
|
|
|
next
|
|
|
|
}
|
|
|
|
|
2018-11-16 05:01:10 +00:00
|
|
|
/(up to date|nothing to see|assuming it will be|loop not entered|# WSYSTYPE)/ {
|
2005-11-26 15:36:47 +00:00
|
|
|
next
|
|
|
|
}
|
|
|
|
|
|
|
|
/(nodes\(%e\)|packed transitions)/ {
|
|
|
|
if(debug) print "% skip2"
|
|
|
|
next
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
# unexpected line
|
2006-07-23 14:36:05 +00:00
|
|
|
clearstatus()
|
2005-11-26 15:36:47 +00:00
|
|
|
if(debug) print "% errors1"
|
|
|
|
errors = 1
|
|
|
|
printf ">>> %s", cmd >out
|
2008-12-06 23:45:15 +00:00
|
|
|
myflush(out)
|
2006-07-23 14:36:05 +00:00
|
|
|
if(copy){
|
|
|
|
printf ">>> %s", cmd >copy
|
2008-12-06 23:45:15 +00:00
|
|
|
myflush(copy)
|
2006-07-23 14:36:05 +00:00
|
|
|
}
|
2005-11-26 15:36:47 +00:00
|
|
|
cmd = ""
|
|
|
|
}
|
|
|
|
|