commit - 604b5fcda415436a4a8e42fcf764c24ae2ca9ed5
commit + 32a580f43cdd51e6b9bbeda91d905cecf3bd68ec
blob - e0c7c8b0fa1eddbb950ff9a174563289fd83314b
blob + d9d381c8b0d1558d77ecfb4de5c6d837ae120e29
--- INSTALL
+++ INSTALL
echo " PLAN9=$PLAN9 export PLAN9"
echo ' PATH=$PATH:$PLAN9/bin export PATH'
fi
-) 2>&1 | tee install.log | awk -f $PLAN9/dist/isum.awk | tee install.sum
+) 2>&1 | tee install.log | awk -f $PLAN9/dist/isum.awk -v'copy='install.sum
blob - fbb2cb92efb3ea1064720dadf6fea338a21c3af8
blob + cb29eb3105da2691c78e3c5d9e716d51c8daf546
--- dist/isum.awk
+++ dist/isum.awk
# print verbose
cd = ""
out = "/dev/stdout"
+ statuslen = 0
debug = 0
+ updates = "/dev/stderr"
}
+function clearstatus( i)
+{
+ if(!updates)
+ return
+ for(i=0; i<statuslen; i++)
+ printf("\b \b") >updates
+ statuslen = 0
+ fflush(updates)
+}
+
+function status(s)
+{
+ if(!updates)
+ return
+ clearstatus()
+ printf(" %s ", s) >updates
+ statuslen = length(s)+5
+ fflush(updates)
+}
+
debug!=0 { print "# " $0 }
/^$/ { next }
/^\+\+ pwd/ { next }
/^\* /{
+ clearstatus()
if(debug) print "% mark"
print >out
fflush(out)
+ if(copy){
+ print >copy
+ fflush(copy)
+ }
cmd = ""
printtabs = 1 # print indented lines immediately following
errors = 0
}
/^ / && printtabs!=0 {
+ clearstatus()
print >out
fflush(out)
+ if(copy){
+ print >copy
+ fflush(copy)
+ }
next
}
if(verbose){
print >out
fflush(out)
+ if(copy){
+ print >copy
+ fflush(copy)
+ }
}
+ else{
+ dir = $2
+ sub(/;$/, "", dir)
+ status(dir)
+ }
cd = $0 "\n"
cmd = ""
next
}
errors != 0 {
+ clearstatus()
if(debug) print "% errors"
printf "%s", cmd >out
fflush(out)
+ if(copy){
+ printf "%s", cmd >copy
+ fflush(copy)
+ }
cmd = ""
next
}
{
# unexpected line
+ clearstatus()
if(debug) print "% errors1"
errors = 1
printf ">>> %s", cmd >out
fflush(out)
+ if(copy){
+ printf ">>> %s", cmd >copy
+ fflush(copy)
+ }
cmd = ""
}