App::CPAN2Pkg::Worker - poe session to drive a module packaging
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
App::CPAN2Pkg::Controller and uses a
App::CPAN2Pkg::Module object to track module information.
A boolean to state whether CPANPLUS has been initialized with new index.
A lock (App::CPAN2Pkg::Lock object) to prevent more than one cpanplus initialization at a time.
The name of the module to build / install / submit / whatever.
my $backend = $worker->cpan2dist_flavour;
Return the cpanplus backend (
CPANPLUS::Dist::*) to be used by the worker when running
$worker->run_command( $command, $event );
$command in another process, and takes care of everything. Since it uses POE::Wheel::Run underneath, it understands various stuff such as running a code reference. Note: commands will be launched under a
Upon completion, yields back an
$event with the result status and the command output.
Check if module is available in the distribution repositories.
Check if the module is installed locally.
Install module from distribution repository.
cpanplus_initialize( $event )
Run CPANPLUS initialization (reload index, etc). Fire
$event when finished, or if this has already been done. Wait 10 seconds before retrying if initialization is currently ongoing.
Run CPANPLUS to find the module prereqs.
Request to wait for local prereqs to be all present before attempting to build the module locally.
local_prereqs_available( $modname )
Inform the worker that
$modname is now available locally. This may unblock the worker from waiting if all the needed modules are present.
Try to create a native package for the module using
Install the native package generated previously by
Import the package in upstream repository.
Request to wait for upstream prereqs to be all present before attempting to build the module locally.
upstream_prereqs_available( $modname )
Inform the worker that
$modname is now available upstream. This may unblock the worker from waiting if all the needed modules are present.
Request package to be built on upstream build system.
Jerome Quelin <email@example.com>
This software is copyright (c) 2009 by Jerome Quelin.