#!/bin/sh # Copyright 2006 Bellière Ludovic # Distributed under the terms of the GNU General Public License v2 # exit on any failures set -e # report unset variables set -u version="1.0c" maintainer="xrogaan@gmail.com" PWD=`pwd` SVNCMD="svn co" CMD_ARCH="tar cpsf" DATE=`date +%Y%m%d` prog=`basename $0` CURRENT="$PWD" TEMPPATH="/tmp/svndatadump_$$" DUMPPATH="${PWD}/dump" PATHS='' ARCHNAME='' ARCHIVETYPE="gz" evalopt=false quietopt=false userev=false EXT='' BLUE="" CYAN="" GREEN="" RED="" OFF="" # synopsis: qprint "message" qprint() { $quietopt || echo "$*" >&2 } # synopsis: mesg "message" # Prettily print something to stderr, honors quietopt mesg() { qprint " ${GREEN}*${OFF} $*" } # synopsis: warn "message" # Prettily print a warning to stderr warn() { echo " ${RED}* Warning${OFF}: $*" >&2 } # synopsis: error "message" # Prettily print an error error() { echo " ${RED}* Error${OFF}: $*" >&2 } # synopsis: die "message" # Prettily print an error, then abort die() { [ -n "$1" ] && error "$*" qprint $evalopt && { echo; echo "false;"; } exit 1 } # synopsis: versinfo # Display the version information versinfo() { qprint qprint "${GREEN}SVN Backup ${version};${OFF}" qprint "Copyright 2006 Belliere Ludovic <${maintainer}>; Distributed under the GPL" qprint } # synopsis: helpinfo # Display the help information. There's no really good way to use qprint for # this... helpinfo() { cat >&2 <