chiark / gitweb /
Test suite: t-archive: DTRT if $suite is not sid
[dgit.git] / tests / lib-reprepro
1 # -*- bash -*-
2
3 t-reprepro () {
4
5  t_archive_method=reprepro
6
7  t-git-config dgit-distro.test-dummy.archive-query aptget:
8  t-git-config dgit-distro.test-dummy.mirror file://$tmp/mirror/
9
10  mkdir $tmp/etc-apt
11  cat >$tmp/etc-apt/conf <<END
12 Dir::Etc "$tmp/etc-apt";
13 END
14  export APT_CONFIG=$tmp/etc-apt/conf
15  gpg --export Hannibal >han.pgp
16  fakeroot apt-key add <han.pgp
17  mkdir $tmp/etc-apt/apt.conf.d
18 }
19
20 t-archive-none-reprepro () {
21         t-reprepro-setup
22         t-reprepro-regen
23 }
24 t-archive-query-reprepro () {
25         local suite=$1
26         local p=$2
27         local v=$3
28         local dscf=$4
29         t-run-reprepro includedsc $suite $tmp/mirror/pool/$dscf
30 }
31
32 t-reprepro-setup () {
33         local rrc=$tmp/mirror/conf
34         mkdir -p $rrc
35         mkdir -p $tmp/mirror/pool/main
36
37         exec 3>$rrc/distributions
38
39         local arch=`dpkg --print-architecture`
40
41         for suitespec in $suitespecs; do
42                 local suite=${suitespec%%:*}
43                 local sname=${suitespec#*:}
44
45                 mkdir $tmp/mirror/dists
46                 rm -f $tmp/mirror/dists/$sname
47                 ln -s $suite $tmp/mirror/dists/$sname
48
49                 cat >&3 <<END
50 Suite: $sname
51 Codename: $suite
52 Components: main
53 Architectures: source binary-$arch
54 SignWith: Hannibal
55
56 END
57         done
58 }
59
60 t-run-reprepro () {
61         reprepro \
62                 --outdir $tmp/mirror \
63                 --basedir $tmp/mirror \
64                 "$@"
65 }
66
67 t-reprepro-regen () {
68         t-run-reprepro export
69 }