diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-10-15 20:34:40 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-10-15 20:36:36 +0100 |
commit | 523f42f6ba9805aae8245af4f996581d6c7c51a3 (patch) | |
tree | 9f1f44eeb7ae28a60968d91b117457630ed86c34 /tests | |
parent | 9a6515f9f4fcf015b1205ff85de5f1bd25c16e57 (diff) |
Test suite: Fix entirely-broken tstunt PERLLIB arrangements
Specifically:
* Properly dereference the variable when looking for the stunt
dir to be there already
* Do not add "." to the path if the path starts out empty.
* Crash _with the right message_ in dpkg-parsechangelog if PERLLIB is
unset. (PERLLIB mustn't be unset because we're trying to strip
our own value from it.)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib | 4 | ||||
-rwxr-xr-x | tests/tstunt/dpkg-parsechangelog | 2 |
2 files changed, 4 insertions, 2 deletions
@@ -696,11 +696,13 @@ t-stunt-envvar () { local var=$1 local tstunt=$2 eval ' - case "'$var'" in + case "$'$var'" in "$tstunt:"*) ;; *":$tstunt:"*) ;; + "") '$var'="$tstunt" ;; *) '$var'="$tstunt:$'$var'" ;; esac + export '$var' ' } diff --git a/tests/tstunt/dpkg-parsechangelog b/tests/tstunt/dpkg-parsechangelog index 1abd00c..4d7cdf8 100755 --- a/tests/tstunt/dpkg-parsechangelog +++ b/tests/tstunt/dpkg-parsechangelog @@ -30,7 +30,7 @@ if (@ARGV) { foreach my $k (qw(PATH PERLLIB)) { my @opath = defined $ENV{$k} ? split /\:/, $ENV{$k} : (); my @npath = grep { $_ ne $strip } @opath; - @npath != @opath or die "$0 $k $ENV{$k} ?"; + @npath != @opath or die "$0 $k ".($ENV{$k}//"(undef)")." ?"; $ENV{$k} = join ':', @npath; } die if $ENV{'DGIT_NO_TSTUNT_CLPARSE'}++; |