develooper Front page | perl.perl5.porters | Postings from March 2000

Re: [ID 20000316.010] CPAN modules status

Thread Previous | Thread Next
From:
Tom Christiansen
Date:
March 17, 2000 20:24
Subject:
Re: [ID 20000316.010] CPAN modules status
Message ID:
13062.953353433@chthon
> > Could CPAN.pm be enhanced so that, when certain errors are encountered, a
> > retry with POLLUTE=1 is attempted?

>Unfortunately not, because CPAN.pm doesn't watch the messages that
>come out of the make run.

my @bad_symbols = qw{
    sv_yes
    sv_no
    sv_undef
    na
};
my $badsym_re = do { 
    local $" = '|'; 
    qr/\b(?:@bad_symbols)\b/;
};

my ($make_out, $make_err);
pipe ($make_out, $make_err)     || die "pipe: $!";

my $bad = 0;
my $pid;

unless ($pid = fork()) {
    defined $pid                || die "fork: $!";
    close $make_out             || die "close: $!";
    open(STDERR, ">&" . fileno($make_err))
				|| die "dup: $!";
    close($make_err)            || die "close: $!";
    exec('make', 'my', 'day')   || die "exec: $!";
} 

close $make_err                 || die "close: $!";
while (<$make_out>) {
    print(STDERR $_)            || die "stderr: $!";  # XXX
    $bad += /$badsym_re/;
} 
close $make_out                 || die "close: $!";
waitpid($pid, 0) == $pid        || die "waitpid: $!";

if ($bad) {   # maybe C<&& $?>?

    #############################
    # remake avec contamination #
    #############################

} 

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About