summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdb-extra42
1 files changed, 42 insertions, 0 deletions
diff --git a/db-extra b/db-extra
new file mode 100755
index 0000000..399c004
--- /dev/null
+++ b/db-extra
@@ -0,0 +1,42 @@
+#!/bin/bash
+# $Id: db-extra,v 1.1 2003/12/21 03:22:27 judd Exp $
+
+uid=`id -u`
+TMPDIR="/tmp/archpkg.$uid"
+repoid=2
+
+# 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
+
+# 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 UNOFFICIAL..." >&2
+cd $TMPDIR
+CVS_RSH=ssh CVSROOT=:ext:cvs.archlinux.org:/home/cvs-extra cvs -q export -r CURRENT extra
+/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
+
+cd $TMPDIR/extra && /arch/pkgdb 2
+
+echo "==> Scanning for missing packages..." >&2
+/arch/genpkglist extra
+
+rm -rf $TMPDIR
+# unlock
+rm -f /tmp/.repolck.$repoid