in reply to Re^7: Cpan install gets stuck installing Net OpenSSH ?
in thread Cpan install gets stuck installing Net OpenSSH ?

I put in some prints and found where it stops. I put a print right before and after this line and it prints the one before but not the one after: my @shells = grep try_shell($_), qw(sh csh bash tcsh ksh dash ash pdksh mksh zsh fish);
  • Comment on Re^8: Cpan install gets stuck installing Net OpenSSH ?

Replies are listed 'Best First'.
Re^9: Cpan install gets stuck installing Net OpenSSH ?
by jtzako (Sexton) on Mar 15, 2016 at 17:54 UTC
    Here I put some prints inside the 'try_shell' sub:
    sub try_shell { my $shell = shift; print "line 1\n"; my $out = eval { capture($shell, '-c', 'echo good') }; print "line 2\n"; if ($out and $out =~ /^good$/) { print "line 3\n"; if ($shell =~ /ksh/) { print "line 4\n"; if (defined (my $version = eval { `$shell --version 2>&1` +})) { print "line 5\n"; if ($version =~ /version\s+sh\s+\(AT\&T\s+Research\)/) + { diag "skipping tests for broken AT&T ksh shell!"; return undef; } } } print "line 6\n"; if ($shell eq '!!fish') { diag "TODO: add support for fish shell!"; return undef; } return 1; } return undef; }
    This is the result:
    -bash-3.2$ sudo perl -Mblib t/quoting.t line 1 line 2 line 3 line 6 line 1 line 2 line 3 line 6 line 1 line 2 line 3 line 6 line 1 line 2 line 3 line 6 line 1 line 2 line 3 line 4 ^C
    I think it makes it through the first 4 shells then gets stuck on the 5th. I think ksh is the 5th one based on the line that calls the sub:
    my @shells = grep try_shell($_), qw(sh csh bash tcsh ksh dash ash pdks +h mksh zsh fish);
      Ah, it seems that the command hanging is ksh --version.

      Until now, all the shells I have checked printed its version or just thrown an error when called with that argument, but it seems you have found one behaving differently.

      Could you give us a bit more detail about your operating system vendor and version, and if possible about the ksh available there?

        SunOS servername 5.10 Generic_150400-11 sun4u sparc SUNW,SPARC-Enterprise

        I'm not entirely sure how to tell what version of KSH I have. "ksh --version" does nothing. "echo ${.sh.version}" gives an error. "echo $KSH_VERSION" does nothing.

        Is there a way I can fix my KSH so it responds? Or, alternatively, get the Net::OpenSSH install to not attempt to run quoting.t ?
Re^9: Cpan install gets stuck installing Net OpenSSH ?
by salva (Canon) on Mar 15, 2016 at 17:49 UTC
    Hmm, it is estrange because when you tested the shells by hand no one did hang...

    Could you continue with your instrumentation inside the function try_shell? You will find it around the middle of the file.

      I removed 'ksh' from the list and the t/quoting.t completes properly.

      I dont know if this would be a problem for the installation that calls t/quoting.t in the first place.