summaryrefslogtreecommitdiffstats
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
parent3d078d5f874b5410267cc6beb73349ffeffce42c (diff)
downloaddbscripts-a1b1d65283834f9108e33b5a4e2945f8259f9d5a.tar.gz
dbscripts-a1b1d65283834f9108e33b5a4e2945f8259f9d5a.tar.xz
improved arch db scripts
-rwxr-xr-xdb-arch27
-rwxr-xr-xdb-unstable24
-rwxr-xr-xgenpkglist3
3 files changed, 35 insertions, 19 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
diff --git a/db-unstable b/db-unstable
index 8fa0388..18554c0 100755
--- a/db-unstable
+++ b/db-unstable
@@ -1,13 +1,23 @@
#!/bin/bash
-# $Id: db-unstable,v 1.4 2003/05/24 00:25:59 judd Exp $
+# $Id: db-unstable,v 1.5 2003/05/25 23:50:02 judd Exp $
-echo "==> Generating pacsync2 Database for UNSTABLE..." >&2
-cd /tmp
+uid=`id -u`
+TMPDIR="/tmp/archpkg.$uid"
+
+# 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 UNSTABLE..." >&2
+cd $TMPDIR
CVS_RSH=ssh CVSROOT=:ext:cvs.archlinux.org:/home/cvs-unstable cvs -q export -r CURRENT unstable
-/usr/bin/gensync /tmp/unstable /tmp/unstable.db.tar.gz
-[ -f /tmp/unstable.db.tar.gz ] && mv -f /tmp/unstable.db.tar.gz /home/ftp/unstable
+/usr/bin/gensync $TMPDIR/unstable $TMPDIR/unstable.db.tar.gz
+[ -f $TMPDIR/unstable.db.tar.gz ] && mv -f $TMPDIR/unstable.db.tar.gz /home/ftp/unstable
-cd /tmp/unstable && /arch/pkgdb 3
+cd $TMPDIR/unstable && /arch/pkgdb 3
-rm -rf /tmp/unstable
+rm -rf $TMPDIR
diff --git a/genpkglist b/genpkglist
index ee4298b..6af0bed 100755
--- a/genpkglist
+++ b/genpkglist
@@ -1,5 +1,5 @@
#!/bin/bash
-# $Id: genpkglist,v 1.6 2003/05/21 23:07:33 judd Exp $
+# $Id: genpkglist,v 1.7 2003/05/25 23:50:02 judd Exp $
#
# genpkglist
@@ -9,7 +9,6 @@
pkgfile="`pwd`/packages.txt"
-cd /tmp/arch/build
rm -f $pkgfile
for category in `find * -type d -maxdepth 0 | grep -v CVS`; do
cd $category