#!/bin/sh # J. Welsh, May 2023 # unique prefix for fragment identifiers, in case multiple articles are viewed per page (derived from article ID of the saved draft) aprefix=a233 printf '

Table of Patches

' $aprefix ls *.patch | while read pname; do type=`sed -n '/^Type:/ { s/^Type: //; p; q }' $pname` color='inherit' case "$type" in *removal*) color='#f88' ;; *structure*) color='#8f8' ;; *import*) color='#acf' ;; *existing*|*portability*) color='#ff8' ;; esac printf '\n' $color printf '\t\n' $aprefix `basename $pname .patch` $pname printf '\t\n' "$type" diffstat -s $pname | awk ' BEGIN { RS="," } /changed/ { changed=$1 } /insertions/ { ins=$1 } /deletions/ { del=$1 } END { printf("\t\n", changed); printf("\t\n", ins); printf("\t\n", del); }' echo '' done echo '
Name Type Files Insertions Deletions
%s%s%d+%d-%d
' ls *.patch | while read pname; do printf '

%s

\n\n' $aprefix `basename $pname .patch` $pname printf '(top - view patch)\n\n' $aprefix $pname echo '
' sed -n '/^diff/ q; /^$/,$ { s/^ //; s/&/\&/g; s/\1|; s/fixpoint.welshcomputing.com/jfxpt.com/g; s|\(http://[^ ]*\)|\1|g; p }' $pname echo '
' done