summaryrefslogtreecommitdiffstats
path: root/db-unstable
diff options
context:
space:
mode:
Diffstat (limited to 'db-unstable')
-rwxr-xr-xdb-unstable18
1 files changed, 12 insertions, 6 deletions
diff --git a/db-unstable b/db-unstable
index e090c88..93e8465 100755
--- a/db-unstable
+++ b/db-unstable
@@ -1,10 +1,17 @@
#!/bin/bash
-# $Id: db-unstable,v 1.8 2003/11/25 01:28:26 judd Exp $
+# $Id: db-unstable,v 1.9 2004/01/06 02:50:53 judd Exp $
uid=`id -u`
TMPDIR="/tmp/archpkg.$uid"
repoid=3
+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}'`
@@ -16,6 +23,8 @@ if [ -d /tmp/.gensync ]; then
exit 1
fi
+# catch ^C breaks
+trap cleanup SIGINT
# lock
touch /tmp/.repolck.$repoid
@@ -32,12 +41,9 @@ CVS_RSH=ssh CVSROOT=:ext:cvs.archlinux.org:/home/cvs-unstable cvs -q export -r C
/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
-cd $TMPDIR/unstable && /arch/pkgdb 3
+cd $TMPDIR/unstable && /arch/pkgdb $repoid
echo "==> Scanning for missing packages..." >&2
/arch/genpkglist unstable
-rm -rf $TMPDIR
-# unlock
-rm -f /tmp/.repolck.$repoid
-
+cleanup