App-CPAN2Pkg

 view release on metacpan or  search on metacpan

lib/App/CPAN2Pkg/Worker.pm  view on Meta::CPAN



no Moose;
__PACKAGE__->meta->make_immutable;
1;

__END__

=pod

=head1 NAME

App::CPAN2Pkg::Worker - poe session to drive a module packaging

=head1 VERSION

version 3.004

=head1 DESCRIPTION

C<App::CPAN2Pkg::Worker> implements a POE session driving the whole
packaging process of a given module. It has different subclasses, used
to match the diversity of Linux distributions.

It is spawned by C<App::CPAN2Pkg::Controller> and uses a
C<App::CPAN2Pkg::Module> object to track module information.

=head1 CLASS ATTRIBUTES

=head2 cpanplus_init

A boolean to state whether CPANPLUS has been initialized with new index.

=head2 cpanplus_lock

A lock (L<App::CPAN2Pkg::Lock> object) to prevent more than one cpanplus
initialization at a time.

=head1 ATTRIBUTES

=head2 module

The name of the module to build / install / submit / whatever.

=head1 METHODS

=head2 cpan2dist_flavour

    my $backend = $worker->cpan2dist_flavour;

Return the cpanplus backend (C<CPANPLUS::Dist::*>) to be used by the
worker when running C<cpan2dist>.

=head2 run_command

    $worker->run_command( $command, $event );

Run a C<$command> in another process, and takes care of everything.
Since it uses L<POE::Wheel::Run> underneath, it understands various
stuff such as running a code reference. Note: commands will be launched
under a C<C> locale.

Upon completion, yields back an C<$event> with the result status and the
command output.

=head1 EVENTS

=head2 check_upstream_availability

    check_upstream_availability( )

Check if module is available in the distribution repositories.

=head2 check_local_availability

    check_local_availability( )

Check if the module is installed locally.

=head2 install_from_upstream

    install_from_upstream( )

Install module from distribution repository.

=head2 cpanplus_initialize

    cpanplus_initialize( $event )

Run CPANPLUS initialization (reload index, etc). Fire C<$event> when
finished, or if this has already been done. Wait 10 seconds before
retrying if initialization is currently ongoing.

=head2 cpanplus_find_prereqs

    cpanplus_find_prereqs( )

Run CPANPLUS to find the module prereqs.

=head2 local_prereqs_wait

    local_prereqs_wait( )

Request to wait for local prereqs to be all present before attempting to
build the module locally.

=head2 local_prereqs_available

    local_prereqs_available( $modname )

Inform the worker that C<$modname> is now available locally. This may
unblock the worker from waiting if all the needed modules are present.

=head2 cpanplus_create_package

    cpanplus_create_package( )

Try to create a native package for the module using C<cpan2dist>.

=head2 local_install_from_package



( run in 0.886 second using v1.01-cache-2.11-cpan-ceb78f64989 )