#!/bin/sh G=/opt/packrat/playpen/public/in-place/git Meta/Make GITWEB_CONFIG=$G/index/gitweb_config.perl gitweb/gitweb.cgi cd gitweb && DEST=`cd ../../index && /bin/pwd` || exit differs= if test -f "$DEST/gitweb.cgi" then diff -u "$DEST/gitweb.cgi" gitweb.cgi || differs="g$differs" else differs="g$differs" fi if test -f "$DEST/gitweb.css" then diff -u "$DEST/gitweb.css" gitweb.css || differs="s$differs" else differs="s$differs" fi if test -f "$DEST/git-favicon.png" then cmp "$DEST/git-favicon.png" git-favicon.png >/dev/null || differs="i$differs" else differs="i$differs" fi case "$differs" in '') echo Up to date. ;; *) while echo -n 'Update [y/N]? ' do read ans case "$ans" in [Yy]) ans=y break ;; '' | [Nn]) ans=n break ;; esac done case "$ans" in y) ;; *) exit esac esac case "$differs" in *g*) rm -f "$DEST/gitweb.cgi" cp gitweb.cgi "$DEST/gitweb.cgi" chmod +x "$DEST/gitweb.cgi" ;; esac case "$differs" in *s*) rm -f "$DEST/gitweb.css" cp gitweb.css "$DEST/gitweb.css" ;; esac case "$differs" in *i*) rm -f "$DEST/git-favicon.png" cp git-favicon.png "$DEST/git-favicon.png" ;; esac