hcoop-git-maint: Only update page if new content is nonempty.
authormwolson_admin <mwolson_admin@deleuze.hcoop.net>
Wed, 17 Sep 2008 04:20:12 +0000 (00:20 -0400)
committermwolson_admin <mwolson_admin@deleuze.hcoop.net>
Wed, 17 Sep 2008 04:20:12 +0000 (00:20 -0400)
hcoop-git-maint

index d148f2a..05e3f37 100755 (executable)
@@ -10,5 +10,9 @@ find /afs/hcoop.net/user -mindepth 3 -maxdepth 3 -noleaf -exec \
 # Update cache of front page.
 cache=/var/local/lib/gitweb/indexcache.html
 wget -q -O $cache.tmp 'http://git.hcoop.net/?nocache=y'
 # Update cache of front page.
 cache=/var/local/lib/gitweb/indexcache.html
 wget -q -O $cache.tmp 'http://git.hcoop.net/?nocache=y'
-chmod a+r $cache.tmp
-mv $cache.tmp $cache
+if test -s $cache.tmp; then
+    chmod a+r $cache.tmp
+    mv $cache.tmp $cache
+else
+    rm -f $cache.tmp
+fi