Perl::Dist::WiX::Toolchain - Compiles the initial toolchain for a Win32 perl distribution.


Perl-Dist-WiX documentation  | view source Contained in the Perl-Dist-WiX distribution.

Index


NAME

Top

Perl::Dist::WiX::Toolchain - Compiles the initial toolchain for a Win32 perl distribution.

VERSION

Top

This document describes Perl::Dist::WiX::Toolchain version 1.500001.

SYNOPSIS

Top

  my $toolchain = Perl::Dist::WiX::Toolchain->new(
    perl_version => '5.012000',       # This is as could be returned from $].
	cpan         => URI::file('C:\\minicpan\'),
	bits         => 32,
  );

  $toolchain->delegate() or die $toolchain->get_error();

  my @dists;
  if (0 < $toolchain->dist_count()) {
	@dists = $toolchain->get_dists();
  }

  ...




DESCRIPTION

Top

This module starts up a copy of the running perl (NOT the perl being built) in order to determine what modules are in the "initial toolchain" and need to be upgraded or installed immediately.

The "initial toolchain" is the modules that are required for CPAN, Module::Build, ExtUtils::MakeMaker, and CPANPLUS (for 5.10.x+ versions of Perl) to be able to install additional modules.

It does not include DBD::SQLite or the modules that are required in order for CPAN or CPANPLUS to use it.

It is a subclass of Process::Delegatable and of Process.

METHODS

Top

new

This method creates a Perl::Dist::WiX::Toolchain object.

See new|Process->new in Process for more information.

The possible parameters that this class defines are as follows:

perl_version

This required parameter defines the version of Perl that we are generating the toolchain for.

This is a string containing a number that is a version of perl in the format of $] ('5.010001' or '5.012000', for example).

cpan

This required parameter defines the CPAN mirror that we are querying.

It has to be a URL in the form of a string.

bits

This required parameter defines the 'bitness' of the Perl that we are generating the toolchain for.

Valid values are 32 or 64.

	my %modules = ( '5.010000' => \@modules_list, );
	$modules{'5.010001'} = $modules{'5.010000'};
	$modules{'5.012000'} = $modules{'5.010000'};
	$modules{'5.012001'} = $modules{'5.010000'};
	$modules{'5.012002'} = $modules{'5.010000'};
	$modules{'5.012003'} = $modules{'5.010000'};
	$modules{'5.014000'} = $modules{'5.010000'};

	return \%modules;
} ## end sub _build_modules







has _corelist_version => ( traits => ['Hash'], is => 'bare', isa => HashRef [Str], builder => '_build_corelist_version', init_arg => undef, lazy => 1, handles => { '_corelist_version_exists' => 'exists', '_get_corelist_version' => 'get', }, );

sub _build_corelist_version {

	my %corelist = (
		'5.010000' => '5.010000',
		'5.010001' => '5.010001',
		'5.012000' => '5.012000',
		'5.012001' => '5.012001',
		'5.012002' => '5.012002',
		'5.012003' => '5.012003',
		'5.014000' => '5.014000',
	);

	return \%corelist;
} ## end sub _build_corelist_version







has _corelist => ( traits => ['Hash'], is => 'bare', isa => HashRef, builder => '_build_corelist', init_arg => undef, lazy => 1, handles => { '_corelist_exists' => 'exists', '_get_corelist' => 'get', }, );

sub _build_corelist { my $self = shift;

	# Confirm we can find the corelist for the Perl version
	my $corelist_version =
	  $self->_get_corelist_version( $self->_get_perl_version() );
	my $corelist = $Module::CoreList::version{$corelist_version}
	  || $Module::CoreList::version{ $corelist_version + 0 };

	if ( not _HASH($corelist) ) {
		Carp::croak( 'Failed to find module core versions for Perl '
			  . $self->_get_perl_version() );
	}

	return $corelist;
} ## end sub _build_corelist







get_dists

  my @distribution_tarballs = $toolchain->get_dists();

Gets the distributions that need updated, as a list of 'PAUSEID/Foo-1.23.tar.gz' strings.

This routine will only return valid values once delegate has returned.

dist_count

  my $distribution_count = $toolchain->dist_count();

Gets a count of the number of distributions that need updated.

This routine will only return valid values once delegate has returned.

get_error

  $toolchain->get_error();

Retrieves any errors that are returned by Process::Delegatable.

delegate

  $toolchain->delegate() or die $toolchain->get_error();

Passes the responsibility for the generation of the initial toolchain to another perl process.

See delegate|Process::Delegatable->delegate in Process::Delegatable for more information.

prepare

Loads the latest CPAN index, in preparation for the run method.

This is not meant to be called by the user, but is called by the delegate method.

run

Queries the CPAN index for what versions of the initial toolchain modules are available,

This is not meant to be called by the user, but is called by the delegate method.

SUPPORT

Top

Bugs should be reported via the CPAN bug tracker at

http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Perl-Dist-WiX

For other issues, contact the author.

AUTHOR

Top

Curtis Jewell <csjewell@cpan.org>

Adam Kennedy <adamk@cpan.org>

SEE ALSO

Top

Perl::Dist::WiX, Module::CoreList, Process, Process::Delegatable

COPYRIGHT AND LICENSE

Top


Perl-Dist-WiX documentation  | view source Contained in the Perl-Dist-WiX distribution.