summaryrefslogtreecommitdiffstats
path: root/db-arch
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2003-05-26 01:50:02 +0200
committerJudd Vinet <judd@archlinux.org>2003-05-26 01:50:02 +0200
commita1b1d65283834f9108e33b5a4e2945f8259f9d5a (patch)
treedd9987a364c2fb16b6304e955737c3f4973ed779 /db-arch
parent3d078d5f874b5410267cc6beb73349ffeffce42c (diff)
downloaddbscripts-a1b1d65283834f9108e33b5a4e2945f8259f9d5a.tar.gz
dbscripts-a1b1d65283834f9108e33b5a4e2945f8259f9d5a.tar.xz
improved arch db scripts
Diffstat (limited to 'db-arch')
-rwxr-xr-xdb-arch27
1 files changed, 17 insertions, 10 deletions
diff --git a/db-arch b/db-arch
index a6b9118..1e24f88 100755
--- a/db-arch
+++ b/db-arch
@@ -1,19 +1,26 @@
#!/bin/bash
-# $Id: db-arch,v 1.7 2003/05/24 00:25:59 judd Exp $
+# $Id: db-arch,v 1.8 2003/05/25 23:50:02 judd Exp $
-echo "==> Updating ABS Tree..." >&2
-cd /tmp
-rm -rf arch
+uid=`id -u`
+TMPDIR="/tmp/archpkg.$uid"
+
+# RedHat's mktemp is broken...
+if [ -d /tmp/archpkg.$uid ]; then
+ echo "==> Removing old temp dir..." >&2
+ rm -rf /tmp/archpkg.$uid || exit 1
+fi
+mkdir /tmp/archpkg.$uid; [ $? -gt 0 ] && exit 1
+
+echo "==> Generating Pacman Database for OFFICIAL..." >&2
+cd $TMPDIR
CVSROOT=:ext:judd@cvs.archlinux.org:/home/cvs-arch cvs -q export -r CURRENT -f arch/build
+/usr/bin/gensync $TMPDIR/arch/build $TMPDIR/current.db.tar.gz
+[ -f $TMPDIR/current.db.tar.gz ] && mv -f $TMPDIR/current.db.tar.gz /home/ftp/current
-cd /tmp/arch/build && /arch/pkgdb 1
+cd $TMPDIR/arch/build && /arch/pkgdb 1
echo "==> Generating Text Package List..." >&2
/arch/genpkglist
mv packages.txt /home/ftp/current/setup/packages.txt
-echo "==> Generating pacsync2 Database for ARCH..." >&2
-/usr/bin/gensync /tmp/arch/build /tmp/current.db.tar.gz
-[ -f /tmp/current.db.tar.gz ] && mv -f /tmp/current.db.tar.gz /home/ftp/current
-
-rm -rf /tmp/arch
+rm -rf $TMPDIR