chiark / gitweb /
Test suite: Fix entirely-broken tstunt PERLLIB arrangements
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Oct 2016 19:34:40 +0000 (20:34 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Oct 2016 19:36:36 +0000 (20:36 +0100)
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>
debian/changelog
tests/lib
tests/tstunt/dpkg-parsechangelog

index 65ecda45c5c79f07364292db521fd84e18b109bf..a60f35a446a974ce43030ec24fd60fcf2277dd75 100644 (file)
@@ -118,6 +118,7 @@ dgit (1.5~~) unstable; urgency=medium
   * Provide better log output for certain failures.
   * Many new tests (especially for new functionality).
   * Add missing debhelper (>=8) to test suite's global Depends.
+  * tstunt arrangements: Fix mishandling of PERLLIB, etc.
 
  --
 
index 6668a1c72d5bd08b5daccaa94738f2038044ed4c..3294cdc0faa62924daa92d7f853a97fb41fd56f8 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -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'
        '
 }
 
index 1abd00ca1800d1bda3b2f1c3516c176d6066e092..4d7cdf84fb3ad426e31ab755dfc3e5e69d3fe682 100755 (executable)
@@ -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'}++;