From 7474eaa17f71f795b803993b0e1c38ff2afe6c1b Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 19 Jul 2015 21:39:04 +0100 Subject: [PATCH 1/1] Test suite: Break out t-make-hook-link. --- debian/changelog | 1 + tests/lib | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6f5ac4d6..661c57ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -33,6 +33,7 @@ dgit (0.31~~) unstable; urgency=low Cleanups: * Remove an obsolete comment from the code. * Improve an error message from dgit-repos-policy-debian. + * Test suite: Break out t-make-hook-link. * Fix a manpage typo. -- diff --git a/tests/lib b/tests/lib index 1179fb09..e81a62ad 100644 --- a/tests/lib +++ b/tests/lib @@ -567,14 +567,20 @@ t-policy-nonexist () { ln -sf no-such-file-or-directory $drs_dispatch/policy-hook } -t-policy () { - local policyhook=$1 - policyhook=${DGIT_INFRA_PFX}$policyhook - case $policyhook in +t-make-hook-link () { + local hook=$1 # in infra/ + local linkpath=$2 + hook=${DGIT_INFRA_PFX}$hook + case $hook in */*) ;; - *) policyhook=`type -P $policyhook` ;; + *) hook=`type -P $hook` ;; esac - ln -sf "$policyhook" $drs_dispatch/policy-hook + ln -sf "$hook" $linkpath +} + +t-policy () { + local policyhook=$1 + t-make-hook-link $policyhook $drs_dispatch/policy-hook } t-debpolicy () { -- 2.30.2