summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2004-04-13 03:47:04 +0200
committerJudd Vinet <judd@archlinux.org>2004-04-13 03:47:04 +0200
commit3982aa170c4e66ab6bc13b1bfa23493d21838611 (patch)
tree5dd8b5e276c93df3762fbf9778fd0bb07048eb38
parentabe20f6ff58f4ef9ed4a6a4670d8c46332ce56cc (diff)
downloaddbscripts-3982aa170c4e66ab6bc13b1bfa23493d21838611.tar.gz
dbscripts-3982aa170c4e66ab6bc13b1bfa23493d21838611.tar.xz
added db-testing
-rwxr-xr-xdb-testing54
1 files changed, 54 insertions, 0 deletions
diff --git a/db-testing b/db-testing
new file mode 100755
index 0000000..a515f25
--- /dev/null
+++ b/db-testing
@@ -0,0 +1,54 @@
+#!/bin/bash
+# $Id: db-testing,v 1.1 2004/04/13 01:47:04 judd Exp $
+
+uid=`id -u`
+repoid=4
+TMPDIR="/tmp/archpkg.$repoid.$uid"
+
+cleanup() {
+ rm -rf $TMPDIR
+ # unlock
+ rm -f /tmp/.repolck.$repoid
+ exit 0
+}
+
+# check for locks
+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
+CVS_RSH=ssh CVSROOT=:ext:cvs.archlinux.org:/home/cvs-arch cvs -q export -r TESTING -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/testing.db.tar.gz /home/ftp/testing
+[ -f $TMPDIR/testing.db.tar.gz ] && mv -f $TMPDIR/testing.db.tar.gz /home/ftp/testing
+
+cd $TMPDIR/arch/build && /arch/pkgdb $repoid
+
+echo "==> Generating Text Package List..." >&2
+/arch/genpkglist testing
+
+cleanup