my $conf = $self->configure_object;
my %hash = @_;
- local $Params::Check::NO_DUPLICATES = 1;
- local $Params::Check::ALLOW_UNKNOWN = 1;
-
my ($mods);
- my $tmpl = {
- modules => { default => [], strict_type => 1,
- required => 1, store => \$mods },
- };
+ my $args = do {
+ local $Params::Check::NO_DUPLICATES = 1;
+ local $Params::Check::ALLOW_UNKNOWN = 1;
+
+ my $tmpl = {
+ modules => { default => [], strict_type => 1,
+ required => 1, store => \$mods },
+ };
- my $args = check( $tmpl, \%hash ) or return;
+ check( $tmpl, \%hash );
+ } or return;
### make them all into module objects ###
- my %mods = map {$_ => $self->parse_module(module => $_) || ''} @$mods;
+ my %mods = map { $_ => $self->parse_module(module => $_) || '' } @$mods;
my $flag; my $href;
while( my($name,$obj) = each %mods ) {
} else {
$author = shift @parts || '';
}
-
- my($pkg, $version, $ext) =
+
+ my($pkg, $version, $ext, $full) =
$self->_split_package_string( package => $dist );
### translate a distribution into a module name ###
my $modobj = CPANPLUS::Module::Fake->new(
module => $maybe->module,
version => $version,
- package => $pkg . '-' . $version . '.' .
- $maybe->package_extension,
+ ### no extension? use the extension the original package
+ ### had instead
+ package => do { $ext
+ ? $full
+ : $full .'.'. $maybe->package_extension
+ },
path => $path,
author => $auth_obj,
_id => $maybe->_id
Writes out a snapshot of your current installation in C<CPAN> bundle
style. This can then be used to install the same modules for a
-different or on a different machine.
+different or on a different machine by issuing the following commands:
+
+ ### using the default shell:
+ CPAN Terminal> i file://path/to/Snapshot_XXYY.pm
+
+ ### using the API
+ $modobj = $cb->parse_module( module => 'file://path/to/Snapshot_XXYY.pm' );
+ $modobj->install;
It will, by default, write to an 'autobundle' directory under your
cpanplus homedirectory, but you can override that by supplying a
my $perl_v = join '', `$^X -V`;
print $fh <<EOF;
-package $name
+package $name;
\$VERSION = '0.01';
$head SYNOPSIS
-perl -MCPANPLUS -e "install $name"
+perl -MCPANPLUS -e "install file://full/path/to/$name"
$head CONTENTS
return $file;
}
+=head2 $bool = $cb->save_state
+
+Explicit command to save memory state to disk. This can be used to save
+information to disk about where a module was extracted, the result of
+C<make test>, etc. This will then be re-loaded into memory when a new
+session starts.
+
+The capability of saving state to disk depends on the source engine
+being used (See C<CPANPLUS::Config> for the option to choose your
+source engine). The default storage engine supports this option.
+
+Most users will not need this command, but it can handy for automated
+systems like setting up CPAN smoke testers.
+
+The method will return true if it managed to save the state to disk,
+or false if it did not.
+
+=cut
+
+sub save_state {
+ my $self = shift;
+ return $self->_save_state( @_ );
+}
+
+
### XXX these wrappers are not individually tested! only the underlying
### code through source.t and indirectly trought he CustomSource plugin.
=pod