You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

82 lines
1.4 KiB

#!/bin/sh
cd gitweb &&
DEST=`cd ../../index && /bin/pwd` || exit
sed -e '
/^our .gitbin = /s|"/usr/bin"|"/home/junio/bin/Linux"|
/^our .GIT = /s|"/usr/bin/|"/home/junio/bin/Linux/|
/^our .projectroot = /s|".*"|"/opt/packrat/playpen/public/in-place/git"|
/^our .stylesheet = /s|".*"|"/gitweb.css"|
/^our .logo = /s|".*"|"/git-logo.png"|
/^our .favicon = /s|".*"|"/git-favicon.png"|
/^our .projects_list = /s|".*"|"/opt/packrat/playpen/public/in-place/git/index/index.aux"|
' gitweb.cgi >gitweb.cgi++
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