[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

commit-email.pl errors on Win2000 (was RE: Are there anyone running Subversion server on Window NT?)

From: Jeff Cave <jeff.cave_at_sunergon.com>
Date: 2003-05-06 21:11:11 CEST

Alright I have to conceed defeat :(

I have no idea how to fix this problem I am having. I cannot get the commit-email.pl to run at all. I just don't have enough perl knowledge.

I have it narrowed down to a couple of lines of code, but don't know enough to figure out what they are doing. It seems that every call to safe_read_from_pipe causes the error:

  '-' is not recognized as an internal or external command,
  operable program or batch file.

safe_read_from_pipe is called from read_from_process. There are 4 calls to it:

  Line 211: my @svnlooklines = &read_from_process($svnlook, 'info', $repos, '-r', $rev);
  Line 218: my @dirschanged = &read_from_process($svnlook, 'dirs-changed', $repos, '-r', $rev);
  Line 237: @svnlooklines = &read_from_process($svnlook, 'changed', $repos, '-r', $rev);
  Line 272: my @difflines = &read_from_process($svnlook, 'diff', $repos, '-r', $rev, @no_diff_deleted);

So of course the error occurs 4 times.

Please

The following two methods are the offending ones and I have marked the place in the code that the error displays at.

# Start a child process safely without using /bin/sh.
sub safe_read_from_pipe
{
  unless (@_)
    {
      croak "$0: safe_read_from_pipe passed no arguments.\n";
    }

  my $pid = open(SAFE_READ, '-|');
  unless (defined $pid)
    {
      die "$0: cannot fork: $!\n";
    }
  unless ($pid)
    {
      open(STDERR, ">&STDOUT")
        or die "$0: cannot dup STDOUT: $!\n";
      exec(@_)
        or die "$0: cannot exec `@_': $!\n";
    }
  my @output;
  while (<SAFE_READ>) ###
    { # Problem displays somewhere in here.
      s/[\r\n]+$//; # Don't know if it happens here or
      push(@output, $_); # if it just gets displayed here.
    } ###
  close(SAFE_READ);
  my $result = $?;
  my $exit = $result >> 8;
  my $signal = $result & 127;
  my $cd = $result & 128 ? "with core dump" : "";
  if ($signal or $cd)
    {
      warn "$0: pipe from `@_' failed $cd: exit=$exit signal=$signal\n";
    }
  if (wantarray)
    {
      return ($result, @output);
    }
  else
    {
      return $result;
    }
}

# Use safe_read_from_pipe to start a child process safely and return
# the output if it succeeded or an error message followed by the output
# if it failed.
sub read_from_process
{
  unless (@_)
    {
      croak "$0: read_from_process passed no arguments.\n";
    }
  my ($status, @output) = &safe_read_from_pipe(@_);
  if ($status)
    {
      return ("$0: `@_' failed with this output:", @output);
    }
  else
    {
      return @output;
    }
}
Received on Tue May 6 21:12:07 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.