NAME

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

VERSION

version 3.000

DESCRIPTION

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.

CLASS ATTRIBUTES

cpanplus_init

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

cpanplus_lock

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

ATTRIBUTES

module

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

METHODS

cpan2dist_flavour

my $backend = $worker->cpan2dist_flavour;

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

run_command

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

Run a $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 C locale.

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

EVENTS

check_upstream_availability

check_upstream_availability( )

Check if module is available in the distribution repositories.

check_local_availability

check_local_availability( )

Check if the module is installed locally.

install_from_upstream

install_from_upstream( )

Install module from distribution repository.

cpanplus_initialize

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.

cpanplus_find_prereqs

cpanplus_find_prereqs( )

Run CPANPLUS to find the module prereqs.

local_prereqs_wait

local_prereqs_wait( )

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

local_prereqs_available

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.

cpanplus_create_package

cpanplus_create_package( )

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

local_install_from_package

local_install_from_package( )

Install the native package generated previously by cpan2dist.

upstream_import_package

upstream_import_package( )

Import the package in upstream repository.

upstream_prereqs_wait

upstream_prereqs_wait( )

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

upstream_prereqs_available

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.

upstream_build_package

upstream_build_package( )

Request package to be built on upstream build system.

AUTHOR

Jerome Quelin <jquelin@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2009 by Jerome Quelin.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.