From: Ian Jackson Date: Wed, 7 Jul 2010 13:09:50 +0000 (+0100) Subject: remove stale caches; do not fail if we need to remake only cache symlink X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ijackson/git?p=rrd-graphs.git;a=commitdiff_plain;h=c9ce15dc76a46f33c3ef0d1157824d2a36e27389 remove stale caches; do not fail if we need to remake only cache symlink --- diff --git a/cgi-invoke b/cgi-invoke index ea20307..cd46ce9 100755 --- a/cgi-invoke +++ b/cgi-invoke @@ -3,9 +3,12 @@ set -e exec with-lock-ex -w data/graph-lock sh -ec ' if ! test -d cache; then quicksand-setup ||: - mkdir $GRAPH_CGI_CACHE + if ! test -d $GRAPH_CGI_CACHE; then mkdir $GRAPH_CGI_CACHE; fi rm -f cache ln -s $GRAPH_CGI_CACHE cache fi + if test cgi -nt cache/.; then + rm -f cache/* + fi ./cgi "$@" ' x "$@"