#!/bin/bash # $Id: db-testing,v 1.12 2006/03/10 23:17:48 judd Exp $ repoid=4 reponame="testing" ftppath="/home/ftp/testing/os/i686" cvspath="/home/cvs-arch" cvsmod="testing" stagedir="$HOME/staging/testing" testing_cleanup() { rm -rf $testingtmp } # catch ^C trap testing_cleanup SIGINT if [ -f /tmp/.repolck.$repoid ]; then owner=`/bin/ls -l /tmp/.repolck.$repoid | awk '{print $3}'` echo "error: db generation is already in progress (started by $owner)" exit 1 fi # lock touch /tmp/.repolck.$repoid # testing is special, so we have to do the CVS checkout stuff here testingtmp=$(mktemp -d /tmp/testtmp-XXXXXX) || exit 1 cvsdir=$testingtmp/testing mkdir $cvsdir cd $cvsdir if [ "`ls $stagedir/add`" -o "`ls $stagedir/del`" ]; then echo "==> Checking out TESTING branches..." >&2 echo "--- CURRENT ---" CVS_RSH=ssh CVSROOT=:ext:cvs.archlinux.org:/home/cvs-arch cvs -q export -r TESTING arch mv arch/build/* . && rm -rf arch echo "--- EXTRA ---" CVS_RSH=ssh CVSROOT=:ext:cvs.archlinux.org:/home/cvs-extra cvs -q export -r TESTING extra cp -a extra/* . && rm -rf extra echo "--- UNSTABLE ---" CVS_RSH=ssh CVSROOT=:ext:cvs.archlinux.org:/home/cvs-unstable cvs -q export -r TESTING unstable cp -a unstable/* . && rm -rf unstable fi # unlock rm -f /tmp/.repolck.$repoid # call the real script . `dirname $0`/db-inc testing_cleanup