#!/bin/sh ###################################################################### # (c) 2005 Yann Dirson # Distributed under version 2 of the GNU GPL. # # darcs-mirror - small script to "push" a darcs repository through an # FTP link. Requires lftp. # # If running this script twice causes files to be re-transmitted, it # is likely a timezone issue. Find the timezone for your ftp server, # and add it to your ~/.lftp/rc. Eg, I have to use the following: # # set ftp:timezone/ftpperso.free.fr GMT # ###################################################################### # Where to store the default FTP site CF=_darcs/prefs/ftprepo # Take target site from command-line, or from default site if any TARGET="$1" if [ -z "$TARGET" ]; then if [ -r $CF ]; then TARGET=`cat $CF` else echo "Don't know where to push" exit 1 fi fi lftp -c "open $TARGET; mirror -Renv --parallel=5 -x '_darcs/prefs/.*repo.*'" if [ $? = 0 -a -e "$1" ]; then # Update prefs/ftprepo if we were given an argument, # and this run succeeded echo "$TARGET" > $CF fi