summaryrefslogtreecommitdiff
path: root/db-testing
blob: 1baad46ce490afdc7da0cef6fad37d9682d7ec26 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# $Id: db-testing,v 1.13 2006/05/05 01:38:33 judd Exp $

repoid=4
reponame="testing"
arch="i686"

ftppath="/home/ftp/testing/os/i686"

cvspath="/home/cvs-arch"
cvsmod="testing"
cvstag="TESTING"

stagedir="$HOME/staging/testing"

testing_cleanup() {
	rm -rf $testingtmp
}

# catch ^C
trap testing_cleanup SIGINT

if [ -f /tmp/.repolck.$arch.$repoid ]; then
	owner=`/bin/ls -l /tmp/.repolck.$arch.$repoid | awk '{print $3}'`
	echo "error: db generation is already in progress (started by $owner)"
	exit 1
fi
# lock
touch /tmp/.repolck.$arch.$repoid

# testing is special, so we have to do the CVS checkout stuff here
testingtmp=$(mktemp -d /tmp/testtmp-XXXXXX) || exit 1
cvsdir=$testingtmp/testing
mkdir $cvsdir
cd $cvsdir

if [ "`ls $stagedir/add`" -o "`ls $stagedir/del`" ]; then
	echo "==> Checking out TESTING branches..." >&2
	echo "--- CURRENT ---"
	CVS_RSH=ssh CVSROOT=:ext:cvs.archlinux.org:/home/cvs-arch cvs -q export -r TESTING arch
	mv arch/build/* . && rm -rf arch
	echo "--- EXTRA ---"
	CVS_RSH=ssh CVSROOT=:ext:cvs.archlinux.org:/home/cvs-extra cvs -q export -r TESTING extra
	cp -a extra/* . && rm -rf extra
	echo "--- UNSTABLE ---"
	CVS_RSH=ssh CVSROOT=:ext:cvs.archlinux.org:/home/cvs-unstable cvs -q export -r TESTING unstable
	cp -a unstable/* . && rm -rf unstable
fi

# unlock
rm -f /tmp/.repolck.$arch.$repoid

# call the real script
. `dirname $0`/db-inc

testing_cleanup