Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 63 lines (54 sloc) 1.62 KB
#!/bin/sh
#
# An all in one script for updating your rsynced CVS repo and git mirrors.
#
# We pass all arguments passed to this script through to drupal-git-sync so you
# can do some handy one liners.
#
# ie.
# Update cvs repo and git mirrors of a couple specific modules.
# drupal_sync views panels
# Update cvs repo and git mirrors of all modules.
# drupal_sync all
# Update cvs repo and git mirrors for all modules in MINE. See drupal_sync.conf
# drupal_sync
#
# NOTE:
# You must setup drupal-git-sync somewhere in your PATH.
#
# Check all dependent scripts/binaries are on the PATH somewhere
for DEP in rsync cvs cvsps git find grep sed; do
which $DEP > /dev/null || exit 1 "Requirement $DEP is nowhere on the PATH"
done
# Get our global sync options.
. /etc/drupal_sync.conf
if [ ! -d $CVSSRV ]; then
mkdir -p $CVSSRV || exit
fi
if [ ! -d $CVSSRV/CVSROOT ]; then
cvs -d$CVSSRV init
chmod u+w $CVSSRV/CVSROOT/modules
echo "drupal drupal\ncontributions contributions" >> $CVSSRV/CVSROOT/modules
chmod u-w $CVSSRV/CVSROOT/modules
fi
# Update our CVS repository.
# We parse through our arguments and see which repositories we need to sync.
CORE=0
CONTRIB=0
for module in $@
do
if [ $module = "core" ] || [ $module = "all" ]; then
CORE=1
fi
if [ $module != "core" ]; then
CONTRIB=1
fi
done
if [ $CORE -ne 0 ]; then
rsync -avz --delete cvs.drupal.org::cvsmirror-core/drupal $CVSSRV # > /dev/null 2>&1
fi
if [ $CONTRIB -ne 0 ]; then
rsync -avz --delete cvs.drupal.org::cvsmirror-contrib/contributions $CVSSRV #> /dev/null 2>&1
fi
# Update git mirrors. We assume you have this in $PATH somewhere.
drupal-git-sync $@