#!/bin/sh
#
# update -- update my home machine files
#
[ -n "$echo" ] && set -x

USAGE='update'

case "$1" in
    -*)
	echo "$USAGE" >&2
	exit 2
	;;
    *)
	;;
esac

STATUS=0
: ${FFLAG=-f}

cd $HOME
get diary .plan .addressbook || STATUS=1

# excluding from the list as too dangerous: bat bin emacs pictures src temp
# as not needed, big, and slow: Mail-OLD thesis jml-releases conferences workshops
for d in classes committees BSDS etc funding LibraryPapers papers posters published research src students talks tech-reports WWW
do
  cd $d || { STATUS=1; continue; }
  get $FFLAG || STATUS=1
  cd $HOME
done

cd $HOME/temp
for d in travel refereeing editing
do
  cd $d || { STATUS=1; continue; }
  get $FFLAG || STATUS=1
  cd ..
done

# omitted as too slow, big, and not needed
# update-mail || STATUS=1
# cd $HOME

cd $HOME || exit 1
svnupdate || STATUS=1
gitupdate || STATUS=1

if test -d texmf
then
    cd texmf/bibtex/bib/misc || exit 1
    make -s all
fi

exit $STATUS
