chiark / gitweb /
test suite: editing a test script overrides DGIT_TESTS_PROGRESSIVE.
[dgit.git] / tests / lib-reprepro
index c304bf8..0a688f6 100644 (file)
@@ -8,11 +8,14 @@ t-reprepro () {
 }
 
 t-reprepro-cfg () {
- local etcapt=$tmp/etc-apt
- local mir=$tmp/mirror
+ local rrinst=$1
+ local rrdistro=${2:-test-dummy}
 
- t-git-config dgit-distro.test-dummy.archive-query aptget:
- t-git-config dgit-distro.test-dummy.mirror file://$mir/
+ local etcapt=$tmp/${rrinst}etc-apt
+ local mir=$tmp/${rrinst}mirror
+
+ t-git-config dgit-distro.$rrdistro.archive-query aptget:
+ t-git-config dgit-distro.$rrdistro.mirror file://$mir/
 
  mkdir $etcapt
  cat >$etcapt/conf <<END
@@ -27,17 +30,21 @@ END
 t-archive-none-reprepro () { # hook called by t-archive-none
        t-reprepro-setup
        t-reprepro-regen
+       local rrinst=
 }
 t-archive-query-reprepro () { # hook called by t-archive-query
        local suite=$1
        local p=$2
        local v=$3
        local dscf=$4
-       t-run-reprepro includedsc $suite $tmp/mirror/pool/$dscf
+       local rrinst=
+       t-reprepro-includedsc $suite $tmp/mirror/pool/$dscf "$rrinst"
 }
 
 t-reprepro-setup () {
-       local mir=$tmp/mirror
+       local rrinst=$1
+
+       local mir=$tmp/${rrinst}mirror
        local rrc=$mir/conf
        mkdir -p $rrc
        mkdir -p $mir/pool/main
@@ -67,8 +74,16 @@ END
        done
 }
 
-t-run-reprepro () {
-       local mir=$tmp/mirror
+t-reprepro-includedsc () {
+       local suite=$1
+       local dscf=$2
+       local rrinst=$3
+       t-reprepro--run includedsc $suite $dscf
+}
+
+t-reprepro--run () {
+       # caller is supposed to have set rrinst
+       local mir=$tmp/${rrinst}mirror
        reprepro \
                --outdir $mir \
                --basedir $mir \
@@ -76,5 +91,7 @@ t-run-reprepro () {
 }
 
 t-reprepro-regen () {
-       t-run-reprepro export
+       local rrinst=$1
+
+       t-reprepro--run export
 }