AnyEvent-Worker

 view release on metacpan or  search on metacpan

inc/Module/AutoInstall.pm  view on Meta::CPAN

173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
    unshift @$modules, $arg;
    $arg = 0;
}
 
# XXX: check for conflicts and uninstalls(!) them.
my $cur = _load($mod);
if (_version_cmp ($cur, $arg) >= 0)
{
    print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n";
    push @Existing, $mod => $arg;
    $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
else {
    if (not defined $cur)   # indeed missing
    {
        print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n";
    }
    else
    {
        # no need to check $arg as _version_cmp ($cur, undef) would satisfy >= above
        print "too old. ($cur < $arg)\n";

inc/Module/AutoInstall.pm  view on Meta::CPAN

211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
                    qq{==> Auto-install the }
                      . ( @required / 2 )
                      . ( $mandatory ? ' mandatory' : ' optional' )
                      . qq{ module(s) from CPAN?},
                    $default ? 'y' : 'n',
                ) =~ /^[Yy]/
            )
          )
        {
            push( @Missing, @required );
            $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
        }
 
        elsif ( !$SkipInstall
            and $default
            and $mandatory
            and
            _prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', )
            =~ /^[Nn]/ )
        {
            push( @Missing, @required );
            $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
        }
 
        else {
            $DisabledTests{$_} = 1 for map { glob($_) } @tests;
        }
    }
 
    if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
        require Config;
        print
"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";
 
        # make an educated guess of whether we'll need root permission.
        print "    (You may need to do that as the 'root' user.)\n"

inc/Module/AutoInstall.pm  view on Meta::CPAN

743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
    require ExtUtils::Manifest;
    my $manifest = ExtUtils::Manifest::maniread('MANIFEST');
 
    $args{EXE_FILES} =
      [ grep { exists $manifest->{$_} } @{ $args{EXE_FILES} } ];
}
 
$args{test}{TESTS} ||= 't/*.t';
$args{test}{TESTS} = join( ' ',
    grep { !exists( $DisabledTests{$_} ) }
      map { glob($_) } split( /\s+/, $args{test}{TESTS} ) );
 
my $missing = join( ',', @Missing );
my $config =
  join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
  if $Config;
 
$PostambleActions = (
    ($missing and not $UnderCPAN)
    ? "\$(PERL) $0 --config=$config --installdeps=$missing"
    : "\$(NOECHO) \$(NOOP)"

inc/Module/Install.pm  view on Meta::CPAN

202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
        );
}
 
my @exts = @{$self->{extensions}};
unless ( @exts ) {
        @exts = $self->{admin}->load_all_extensions;
}
 
my %seen;
foreach my $obj ( @exts ) {
        while (my ($method, $glob) = each %{ref($obj) . '::'}) {
                next unless $obj->can($method);
                next if $method =~ /^_/;
                next if $method eq uc($method);
                $seen{$method}++;
        }
}
 
my $who = $self->_caller;
foreach my $name ( sort keys %seen ) {
        local $^W;

lib/AnyEvent/Worker.pm  view on Meta::CPAN

313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
}
 
our %KIDW;
our %TERM;
 
sub kill_child {
        my $self      = shift;
        my $child_pid = delete $self->{child_pid};
        my $GD = 0;
        {
                local $SIG{__WARN__} = sub { $GD = 1 if $_[0] =~ / during global destruction\.\s*$/ };
                warn 'test';
        }
        #print STDERR "killing $child_pid / $GD\n";
        if ($child_pid) {
                # send SIGKILL in two seconds
                $TERM{$child_pid}++;
                kill 0 => $child_pid and
                kill TERM => $child_pid or $!{ESRCH} or warn "kill $child_pid: $!";
                return if $GD;
                # MAYBE: kill timer

lib/AnyEvent/Worker.pm  view on Meta::CPAN

352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
                                #undef $murder_timer;
                        },
                );
                 
                close $self->{fh};
        }
}
sub END {
        my $GD = 0;
        {
                local $SIG{__WARN__} = sub { $GD = 1 if $_[0] =~ / during global destruction\.\s*$/ };
                warn 'test';
        }
        #print STDERR "END $!/$? GD=$GD\n";
        for (keys %TERM) {
                delete $KIDW{$_};
                #print STDERR "END kill $_\n";
                kill 0 => $_ and do {
                        kill KILL => $_ or warn "kill $_ failed: $!";
                        #print STDERR "END waitpid $_\n";
                        my $wp = waitpid $_,0;



( run in 0.256 second using v1.01-cache-2.11-cpan-95122f20152 )