#!/bin/sh setglobal T = $1 for h in [\ *.txt *.html \ howto/*.txt howto/*.html \ technical/*.txt technical/*.html \ RelNotes/*.txt *.css] { if test ! -f $h { : did not match } elif test -f "$T/$h" && $DIFF -u -I'^Last updated ' "$T/$h" $h { :; # up to date } else { echo >&2 "# install $h $T/$h> !2 "# install $h $T/$h" rm -f "$T/$h" mkdir -p $[dirname "$T/$h] cp $h "$T/$h" } } setglobal strip_leading = $[echo "$T/" | sed -e 's|.|.|g] for th in [\ "$T"/*.html "$T"/*.txt \ "$T"/howto/*.txt "$T"/howto/*.html \ "$T"/technical/*.txt "$T"/technical/*.html] { setglobal h = $[expr $th : "$strip_leading"'\(.*\)] match $h { with RelNotes-*.txt | index.html continue } test -f $h && continue echo >&2 "# rm -f $th> !2 "# rm -f $th" rm -f $th } ln -sf git.html "$T/index.html"