URI: 
       tnew isum - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit dc794ede54bb743e3d2ef1c096db38377e3d8b0f
   DIR parent 1282ec7a2e0345d4a61258e9705fe1844480948a
  HTML Author: rsc <devnull@localhost>
       Date:   Sat, 26 Nov 2005 15:36:47 +0000
       
       new isum
       
       Diffstat:
         M dist/isum                           |       5 +----
         A dist/isum.awk                       |      92 +++++++++++++++++++++++++++++++
       
       2 files changed, 93 insertions(+), 4 deletions(-)
       ---
   DIR diff --git a/dist/isum b/dist/isum
       t@@ -1,7 +1,4 @@
        #!/bin/sh
        
       -# LC_CTYPE=C works around stupidity in GNU grep
       -# With LC_CTYPE=en_US.UTF-8 this is MUCH slower.
       -LC_CTYPE=C export LC_CTYPE
       +awk -f $PLAN9/dist/isum.awk $PLAN9/install.log
        
       -egrep -v '^(\+ )?(9a|9c|9l|9ar|install|cp|cd|rm|mv|mk|9 yacc|9 lex|for i|do|done|if \[|fi|else|then)([         ]|$)|^[         ]+(\(cd|mk|gcc|cpp|cp)( |$)|^[ar] - |up to date|nothing to see here|assuming it will be an archive|loop not entered at top|conflicts:|nodes\(%e\)|packed transitions|Add these|PLAN9=|PATH=|^[         ]*$|^SYSNAME=|^OBJTYPE=|^sh |^cmp |^\./o\.rgb|^rc \./manweb' $PLAN9/install.log
   DIR diff --git a/dist/isum.awk b/dist/isum.awk
       t@@ -0,0 +1,92 @@
       +# Summarize the installation log, printing errors along with
       +# enough context to make sense of them.
       +
       +BEGIN {
       +#        print verbose 
       +        cd = ""
       +        out = "/dev/stdout";
       +}
       +
       +debug { print "# " $0 }
       +
       +/^$/ { next }
       +
       +/^\* /{
       +        if(debug) print "% mark"
       +        print >out
       +        fflush(out)
       +        cmd = ""
       +        printtabs = 1        # print indented lines immediately following
       +        errors = 0
       +        next
       +}
       +
       +/^        / && printtabs {
       +        print >out
       +        fflush(out)
       +        next
       +}
       +
       +{ printtabs = 0 }
       +
       +/^(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)($|[^:])/ {
       +        if(debug) print "% start"
       +        errors = 0
       +        cmd = ""
       +        if(!verbose)
       +                cmd = cmd cd
       +        cmd = cmd $0 "\n"
       +        next
       +}
       +
       +/^cd / {
       +        if(debug) print "% cd"
       +        errors = 0
       +        if(verbose){
       +                print >out
       +                fflush(out)
       +        }
       +        cd = $0 "\n"
       +        cmd = ""
       +        next
       +}
       +
       +{
       +        cmd = cmd $0 "\n"
       +}
       +
       +errors {
       +        if(debug) print "% errors"
       +        printf "%s", cmd >out
       +        fflush(out)
       +        cmd = ""
       +        next
       +}
       +
       +/^(        |then|else|fi|done|[ar] - [^ ]*\.o$)/ {
       +        next
       +}
       +
       +/^(up to date|nothing to see|assuming it will be|loop not entered|conflicts:)/ {
       +        if(debug) print "% skip1"
       +        next
       +}
       +
       +/is up to date/ {
       +        next
       +}
       +
       +/(nodes\(%e\)|packed transitions)/ {
       +        if(debug) print "% skip2"
       +        next
       +}
       +
       +{ 
       +        # unexpected line 
       +        if(debug) print "% errors1"
       +        errors = 1
       +        printf ">>> %s", cmd >out
       +        fflush(out)
       +        cmd = ""
       +}
       +