App-MechaCPAN
view release on metacpan or search on metacpan
- Consolidate use of CoreList so we can also check if a module is deprecated
and act like it's not core if it is deprecated. GH#12
- Bug fix for the tests that attempted to install Test::More when core perl
had the same version as cpan. Fixes perl rt #133617
0.25 2018-10-17 22:45:47 EDT
- Add fixes for fetch_file that was preventing successful testing on
cpantesters, including the difference with BSD's tar that an empty input
is not an error.
0.24 2018-10-08 23:12:15 EDT
- Display the path to the log file (GH#8)
- Add the --shared-lib option (GH#8)
- Improve restart_script to work better without --directory (GH#8)
- Copy App::MechaCPAN to the new locations if it doesn't already exist
in the destination directory (GH#8)
- Thanks to James Pattie/pattieja1 for the changes and testing with GH#8
- Logs now have a much more humane name that includes a timestamp
- The amount of random, temporary files, both during processing as well as
after exceptions, has been reduced
- System tar will now be used before Archive::Tar if possible
lib/App/MechaCPAN/Install.pm view on Meta::CPAN
=head3 install-man
By default, man pages are not installed. Use this option to install the man pages.
=head3 source
Add a source translation to the installation. This can be used to translate a module name into another form, like using an exact version of a module or pull another module from its git repo. This can be repeated multiple times for multiple translatio...
# Examples of --source
mechacpan install Catalyst --source Try::Tiny=ETHER/Try-Tiny-0.24
mechacpan install Catalyst --source Catalyst=git://git.shadowcat.co.uk/catagits/Catalyst-Runtime.git
=head3 only-sources
Do not use modules not listed in the source list. This means if you do not specify every module and every prerequisite in the source list, then it will not be installed. This doesn't sound very useful since you would be potentially listing hundreds o...
=head3 update
If an older version of a given module is installed, a newer version will be installed. This is on by default.
use strict;
use FindBin;
use Test::More;
require q[./t/helper.pm];
foreach my $src (
qw[
https://github.com/p5sagit/Try-Tiny.git
https://github.com/p5sagit/Try-Tiny.git@v0.24
https://github.com/p5sagit/Try-Tiny/archive/v0.24.zip
],
)
{
like($src, App::MechaCPAN::url_re(), "$src is like a url");
}
my %git_srcs = (
'git://git@github.com/p5sagit/Try-Tiny.git' => [ qw[git://git@github.com/p5sagit/Try-Tiny.git] ],
'git://git@github.com/p5sagit/Try-Tiny.git@v0.24' => [ qw[git://git@github.com/p5sagit/Try-Tiny.git v0.24] ],
);
foreach my $src (sort keys %git_srcs)
{
like($src, App::MechaCPAN::git_re(), "$src is like a git_url");
like($src, App::MechaCPAN::git_extract_re(), "$src can be extracted");
my @exparts = @{ $git_srcs{$src} };
my @parts = $src =~ App::MechaCPAN::git_extract_re();
is(@parts[0], @exparts[0], 'git url is correct');
t/07_tmpdata.t view on Meta::CPAN
use File::Temp qw/tempdir/;
require q[./t/helper.pm];
my $pwd = cwd;
my $tmpdir = tempdir( TEMPLATE => File::Spec->tmpdir . "/mechacpan_t_XXXXXXXX", CLEANUP => 1 );
local $App::MechaCPAN::PROJ_DIR = $tmpdir;
chdir $tmpdir;
my $dir = cwd;
my $test_filename = 'v0.24.zip';
my $test_url = "https://github.com/p5sagit/Try-Tiny/archive/$test_filename";
my $type = join( '', map { ( 'a' .. 'z' )[ int rand 26 ] } ( 1 .. 4 ) );
my $humane_pattern = qr{ mecha_ .*? [.] [\d_]* [.] [^.]* }xms;
my $type_pattern = qr{ mecha_$type [.] [\d_]* [.] X* }xms;
my $log_pattern = qr{ mecha_log [.] [\d_]* [.] }xms;
like( App::MechaCPAN::humane_tmpname($type), qr/^$type_pattern$/, 'Humane name is maintained' );
# Test log names
{
t/22_install__get_targz.t view on Meta::CPAN
my $has_git = &App::MechaCPAN::has_git;
local $ENV{GIT_SSL_NO_VERIFY}='true';
# Notes:
# * we don't test with git or ssh since those require some kind of login
# * File::Remove is included to make sure that it's not confused with file://
foreach my $src (
qw[
test_dists/NoDeps/NoDeps-1.0.tar.gz
authors/id/E/ET/ETHER/Try-Tiny-0.24.tar.gz
E/ET/ETHER/Try-Tiny-0.24.tar.gz
ETHER/Try-Tiny-0.24.tar.gz
https://github.com/p5sagit/Try-Tiny.git
https://github.com/p5sagit/Try-Tiny.git@v0.24
https://github.com/p5sagit/Try-Tiny/archive/v0.24.zip
Try::Tiny
Try::Tiny@0.24
Try::Tiny~0.24
Try::Tiny~<0.24
File::Remove
],
[qw/Try::Tiny 0.24/],
[qw/Try::Tiny <0.24/],
)
{
SKIP:
{
if ( $src =~ m/[.]git/xms && !$has_git )
{
skip "git not available", 1;
}
local $App::MechaCPAN::Install::dest_dir
t/25_depend_source.t view on Meta::CPAN
my $tmpdir = tempdir( TEMPLATE => File::Spec->tmpdir . "/mechacpan_t_XXXXXXXX", CLEANUP => 1 );
chdir $tmpdir;
my $dir = cwd;
my $lib = 'ConfigDeps';
my $deplib = 'Try/Tiny';
my $options = {
source => {
$lib => "$pwd/test_dists/$lib/$lib-1.0.tar.gz",
'Try::Tiny' => 'E/ET/ETHER/Try-Tiny-0.24.tar.gz',
},
};
diag("cwd => $dir");
diag("Try::Tiny => $INC{'Try/Tiny.pm'}");
is( App::MechaCPAN::Install->go( $options, "$lib" ), 0, 'Can use a source' );
diag("Try::Tiny => $INC{'Try/Tiny.pm'}");
is( cwd, $dir, 'Returned to whence it started' );
t/25_depend_source.t view on Meta::CPAN
{
# Silence warnings for the require_ok. If the user has LWP installed, then
# it will cause harmless warnings about redefined subs. These don't cause
# errors and just add to the noise in cpantesters.
local $SIG{__WARN__} = sub {};
require_ok("$dir/local/lib/perl5/$deplib.pm");
}
diag("Try::Tiny => $INC{'Try/Tiny.pm'}");
is( $Try::Tiny::VERSION, '0.24', "The correct version was installed" );
chdir $pwd;
done_testing;
t/33_snapshot.t view on Meta::CPAN
require q[./t/helper.pm];
my $pwd = cwd;
my $cpanfile = "$FindBin::Bin/../test_dists/DeploySnapshot/cpanfile";
my $snapshot = "$cpanfile.snapshot";
my $cpanfile_info = App::MechaCPAN::Deploy::parse_snapshot($snapshot);
my $output = {
'Try-Tiny-0.24' => {
'pathname' => 'E/ET/ETHER/Try-Tiny-0.24.tar.gz',
'provides' => { 'Try::Tiny' => '0.24' },
'requirements' => {
'Carp' => '0',
'warnings' => '0',
'constant' => '0',
'Exporter' => '5.57',
'ExtUtils::MakeMaker' => '0',
'perl' => '5.006',
'strict' => '0'
}
}
t/35_deploy_snapshot.t view on Meta::CPAN
ok( -e "$dir/local/lib/perl5/$lib", "Library file $lib exists" );
{
# Silence warnings for the require_ok. If the user has LWP installed, then
# it will cause harmless warnings about redefined subs. These don't cause
# errors and just add to the noise in cpantesters.
local $SIG{__WARN__} = sub {};
require_ok("$dir/local/lib/perl5/$lib");
}
is( $Try::Tiny::VERSION, '0.24', "The correct version was installed" );
chdir $pwd;
done_testing;
test_dists/DeploySnapshot/cpanfile.snapshot view on Meta::CPAN
# carton snapshot format: version 1.0
DISTRIBUTIONS
Try-Tiny-0.24
pathname: E/ET/ETHER/Try-Tiny-0.24.tar.gz
provides:
Try::Tiny 0.24
requirements:
Carp 0
Exporter 5.57
ExtUtils::MakeMaker 0
constant 0
perl 5.006
strict 0
warnings 0
( run in 1.519 second using v1.01-cache-2.11-cpan-7add2cbd662 )