blob: 27ad735f2edeafb6659eb2544c507163cde40bf0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#!/bin/bash
# $Id: db-extra,v 1.2 2003/12/21 03:23:28 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 EXTRAL..." >&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
|