App-MechaCPAN
view release on metacpan or search on metacpan
lib/App/MechaCPAN/Deploy.pm view on Meta::CPAN
sub parse_snapshot
{
my $file = shift;
my $result = {};
open my $snap_fh, '<', $file;
if ( my $line = <$snap_fh> !~ $snapshot_re )
{
die "File doesn't looks like a carton snapshot: $file";
}
my @stack = ($result);
my $prefix = '';
while ( my $line = <$snap_fh> )
{
chomp $line;
if ( $line =~ m/^ \Q$prefix\E (\S+?) :? $/xms )
{
lib/App/MechaCPAN/Install.pm view on Meta::CPAN
# Check to see if the source is a cpanfile
if ( ref $src_name eq '' || ref $src_name eq 'GLOB' )
{
if ( -d $src_name )
{
$src_name = File::Spec->catfile( $src_name, 'cpanfile' );
}
if ( -e -f $src_name )
{
# If the filename includes the work cpanfile or looks like a text file,
# assume it's a cpanfile because a module archive must be binary
if ( $src_name =~ m/cpanfile/ || -T $src_name )
{
return _targets_from_cpanfile( $src_name, $cache, $update );
}
}
}
my $target = _create_target( $src_name, $cache );
$target->{update} = $update // 1;
lib/App/MechaCPAN/Perl.pm view on Meta::CPAN
C<$version> is either 0 or 1 parameter:
=over
=item * If 0 parameters are given and there is a .perl-version file, it will try and use that as the version to install.
=item * Otherwise, if 0 parameters are given, it will attempt to find and install the newest, stable version of perl.
=item * If the parameter is a file, it will try to use that file as an archive to install perl.
=item * If the parameter looks like a URL, it will fetch that URL and try to use it as an archive to install perl.
=item * If the parameter is a major version (5.XX), it will attempt to download and install the newest minor version of that major version.
=item * If the parameter is a minor version (5.XX.X), it will attempt to download and install that exact version.
=back
In the cases where a version is given, and the C<--no-source-only> option is given, C<App::MechaCPAN::Perl> will attempt to download a binary archive prebuilt for the operating system. This guess is made by looking at how the currently executing L<pe...
After an archive is retrieved, it will be checked to see if it is a binary or source package. This is accomplished by checking for an executable C<bin/perl> file in the archive. Basic tests are ran to make sure the binary is usable, notably by runnin...
( run in 0.923 second using v1.01-cache-2.11-cpan-64827b87656 )