From f277673d7e083f2cb32537a1764c1819edecb923 Mon Sep 17 00:00:00 2001 From: Judd Vinet Date: Thu, 1 Apr 2004 21:04:14 +0000 Subject: changed mysql temp file so one user can run multiple db-gen scripts concurrently --- db-arch | 9 +++++++-- db-extra | 9 +++++++-- db-unstable | 9 +++++++-- pkgdb | 8 ++++---- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/db-arch b/db-arch index d2c93b8..506346b 100755 --- a/db-arch +++ b/db-arch @@ -1,9 +1,9 @@ #!/bin/bash -# $Id: db-arch,v 1.13 2004/01/06 02:50:53 judd Exp $ +# $Id: db-arch,v 1.14 2004/04/01 21:09:13 judd Exp $ uid=`id -u` -TMPDIR="/tmp/archpkg.$uid" repoid=1 +TMPDIR="/tmp/archpkg.$repoid.$uid" cleanup() { rm -rf $TMPDIR @@ -38,6 +38,11 @@ mkdir /tmp/archpkg.$uid; [ $? -gt 0 ] && exit 1 echo "==> Generating Pacman Database for CURRENT..." >&2 cd $TMPDIR CVS_RSH=ssh CVSROOT=:ext:cvs.archlinux.org:/home/cvs-arch cvs -q export -r CURRENT -f arch/build +# check again +if [ -d /tmp/.gensync ]; then + echo "error: someone else is currently running gensync!" + exit 1 +fi /usr/bin/gensync $TMPDIR/arch/build $TMPDIR/current.db.tar.gz /home/ftp/current [ -f $TMPDIR/current.db.tar.gz ] && mv -f $TMPDIR/current.db.tar.gz /home/ftp/current diff --git a/db-extra b/db-extra index b50c7a6..204366f 100755 --- a/db-extra +++ b/db-extra @@ -1,9 +1,9 @@ #!/bin/bash -# $Id: db-extra,v 1.4 2004/01/06 02:50:53 judd Exp $ +# $Id: db-extra,v 1.5 2004/04/01 21:09:13 judd Exp $ uid=`id -u` -TMPDIR="/tmp/archpkg.$uid" repoid=2 +TMPDIR="/tmp/archpkg.$repoid.$uid" cleanup() { rm -rf $TMPDIR @@ -38,6 +38,11 @@ mkdir $TMPDIR; [ $? -gt 0 ] && exit 1 echo "==> Generating Pacman Database for EXTRA..." >&2 cd $TMPDIR CVS_RSH=ssh CVSROOT=:ext:cvs.archlinux.org:/home/cvs-extra cvs -q export -r CURRENT extra +# check again +if [ -d /tmp/.gensync ]; then + echo "error: someone else is currently running gensync!" + exit 1 +fi /usr/bin/gensync $TMPDIR/extra $TMPDIR/extra.db.tar.gz /home/ftp/extra [ -f $TMPDIR/extra.db.tar.gz ] && mv -f $TMPDIR/extra.db.tar.gz /home/ftp/extra diff --git a/db-unstable b/db-unstable index 93e8465..6e0efa5 100755 --- a/db-unstable +++ b/db-unstable @@ -1,9 +1,9 @@ #!/bin/bash -# $Id: db-unstable,v 1.9 2004/01/06 02:50:53 judd Exp $ +# $Id: db-unstable,v 1.10 2004/04/01 21:09:13 judd Exp $ uid=`id -u` -TMPDIR="/tmp/archpkg.$uid" repoid=3 +TMPDIR="/tmp/archpkg.$repoid.$uid" cleanup() { rm -rf $TMPDIR @@ -38,6 +38,11 @@ mkdir $TMPDIR; [ $? -gt 0 ] && exit 1 echo "==> Generating Pacman Database for UNSTABLE..." >&2 cd $TMPDIR CVS_RSH=ssh CVSROOT=:ext:cvs.archlinux.org:/home/cvs-unstable cvs -q export -r CURRENT unstable +# check again +if [ -d /tmp/.gensync ]; then + echo "error: someone else is currently running gensync!" + exit 1 +fi /usr/bin/gensync $TMPDIR/unstable $TMPDIR/unstable.db.tar.gz /home/ftp/unstable [ -f $TMPDIR/unstable.db.tar.gz ] && mv -f $TMPDIR/unstable.db.tar.gz /home/ftp/unstable diff --git a/pkgdb b/pkgdb index 69affd0..4ccb54f 100755 --- a/pkgdb +++ b/pkgdb @@ -1,14 +1,14 @@ #!/bin/bash -# $Id: pkgdb,v 1.11 2004/02/20 09:20:32 judd Exp $ +# $Id: pkgdb,v 1.12 2004/04/01 21:04:14 judd Exp $ tl=`pwd` +repoid=$1 # we use this instead of mktemp cuz the RH server's mktemp is broken :( uid=`id -u` -TMPFILE="/tmp/.mysqltmp.$uid.1" -TMPFILE2="/tmp/.mysqltmp.$uid.2" +TMPFILE="/tmp/.mysqltmp.$uid.$repoid.1" +TMPFILE2="/tmp/.mysqltmp.$uid.$repoid.2" -repoid=$1 dbuser='archweb' dbname='archweb' dbpass='YWkrOjqm' -- cgit v1.2.3-54-g00ecf