diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-01-07 15:54:50 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-01-08 22:14:26 +0000 |
commit | cb53d76e42575c95c3d4fbc4fdc90e276c221c86 (patch) | |
tree | 828b2d7fbb8f6ce1b00c96ed6e570e023a15f1a0 /tests | |
parent | 8963f3d0cf1aa5478af5875a958a5129c0aff277 (diff) |
test suite: lib-reprepro: Allow configuring for another distro
We can now make a second `distro' this way, with some additional
optional arguments.
No functional change for existing call sites.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib-reprepro | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/tests/lib-reprepro b/tests/lib-reprepro index c304bf8..d788a69 100644 --- a/tests/lib-reprepro +++ b/tests/lib-reprepro @@ -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--run includedsc $suite $tmp/mirror/pool/$dscf } 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,9 @@ END done } -t-run-reprepro () { - local mir=$tmp/mirror +t-reprepro--run () { + # caller is supposed to have set rrinst + local mir=$tmp/${rrinst}mirror reprepro \ --outdir $mir \ --basedir $mir \ @@ -76,5 +84,7 @@ t-run-reprepro () { } t-reprepro-regen () { - t-run-reprepro export + local rrinst=$1 + + t-reprepro--run export } |