diff options
author | Judd Vinet <judd@archlinux.org> | 2006-02-20 07:33:40 +0100 |
---|---|---|
committer | Judd Vinet <judd@archlinux.org> | 2006-02-20 07:33:40 +0100 |
commit | a49feb74bba7a0dfe7f5a546fc4a188ded208c61 (patch) | |
tree | d380b8f8aa3cc73c58709f18e028c776c2248b88 /db-testing | |
parent | 7c99f3e12b92f5112f3f79bf55deebcab6c3fc11 (diff) | |
download | dbscripts-a49feb74bba7a0dfe7f5a546fc4a188ded208c61.tar.gz dbscripts-a49feb74bba7a0dfe7f5a546fc4a188ded208c61.tar.xz |
re-worked db-gen scripts -- new and improved
Diffstat (limited to 'db-testing')
-rwxr-xr-x | db-testing | 82 |
1 files changed, 34 insertions, 48 deletions
@@ -1,68 +1,54 @@ #!/bin/bash -# $Id: db-testing,v 1.10 2005/02/25 21:27:44 judd Exp $ +# $Id: db-testing,v 1.11 2006/02/20 06:33:40 judd Exp $ -uid=`id -u` repoid=4 +reponame="testing" + ftppath="/home/ftp/testing/os/i686" -TMPDIR="/tmp/archpkg.$repoid.$uid" +cvspath="/home/cvs-arch" +cvsmod="testing" + +stagedir="$HOME/staging/testing" -cleanup() { - rm -rf $TMPDIR - # unlock - rm -f /tmp/.repolck.$repoid - exit 0 +testing_cleanup() { + rm -rf $testingtmp } -# check for locks +# catch ^C +trap 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 -if [ -d /tmp/.gensync ]; then - echo "error: someone else is currently running gensync!" - exit 1 -fi - -# catch ^C breaks -trap cleanup SIGINT # lock touch /tmp/.repolck.$repoid -# RedHat's mktemp is broken... -if [ -d $TMPDIR ]; then - echo "==> Removing old temp dir..." >&2 - rm -rf $TMPDIR || exit 1 -fi -mkdir $TMPDIR; [ $? -gt 0 ] && exit 1 - -echo "==> Generating Pacman Database for TESTING..." >&2 -cd $TMPDIR -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 -# check again -if [ -d /tmp/.gensync ]; then - echo "error: someone else is currently running gensync!" - cleanup - exit 1 +# 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 -/usr/bin/gensync $TMPDIR $TMPDIR/testing.db.tar.gz $ftppath -[ -f $TMPDIR/testing.db.tar.gz ] && mv -f $TMPDIR/testing.db.tar.gz $ftppath -echo "==> Scanning for New/Updated/Deleted packages..." >&2 -cd $TMPDIR -/arch/pkgdb1 $repoid | /arch/pkgdb2 $repoid $ftppath +# unlock +rm -f /tmp/.repolck.$repoid -echo "==> Generating Text Package List..." >&2 -/arch/genpkglist testing -mv packages.txt $ftppath/packages.txt +# call the real script +. `dirname $0`/db-inc -cleanup +testing_cleanup |