line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ShipIt::ProjectType::Perl::MakeMaker; |
2
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
87
|
|
3
|
2
|
|
|
2
|
|
12
|
use base 'ShipIt::ProjectType::Perl'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
228
|
|
4
|
2
|
|
|
2
|
|
2307
|
use ExtUtils::Manifest qw(manicheck skipcheck filecheck); |
|
2
|
|
|
|
|
21361
|
|
|
2
|
|
|
|
|
231
|
|
5
|
2
|
|
|
2
|
|
24
|
use ShipIt::Util qw(make_var); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
84
|
|
6
|
2
|
|
|
2
|
|
12
|
use Config; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1149
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
2
|
|
|
2
|
0
|
7
|
my ($class) = @_; |
10
|
2
|
|
|
|
|
23
|
my $self = $class->SUPER::new; |
11
|
2
|
50
|
|
|
|
1813
|
my $make = $Config{make} or die "You don't have make"; |
12
|
2
|
50
|
|
|
|
6554
|
my $quot = $^O eq 'MSWin32' ? q/"/ : q/'/; |
13
|
2
|
50
|
33
|
|
|
16
|
$make = "$quot$make$quot" if $make =~ /\s/ && $make !~ /^$quot/; |
14
|
2
|
|
|
|
|
35
|
$self->{make} = $make; |
15
|
2
|
|
|
|
|
16
|
return $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub prepare_build { |
19
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
20
|
0
|
0
|
|
|
|
|
system("perl", "Makefile.PL") and die "Makefile.PL failed"; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub run_build { |
24
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
25
|
0
|
|
|
|
|
|
my($cmd) = @_; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
!system($self->{make}, $cmd); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# returns 1 if a make disttest succeeds. |
31
|
|
|
|
|
|
|
sub disttest { |
32
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
$self->prepare_build; |
35
|
0
|
0
|
|
|
|
|
$self->run_build('disttest') or die "Disttest failed"; |
36
|
0
|
0
|
|
|
|
|
$self->run_build('distclean') or die "Distclean failed"; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my @missing = manicheck; |
39
|
0
|
|
|
|
|
|
my @extra = filecheck; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# Module::Install creates inc/ in perl Makefile.PL and META.yml in make |
42
|
0
|
|
|
|
|
|
my $missing_ignore = join "|", qw( ^META\.yml$ ^inc/ ); |
43
|
0
|
|
|
|
|
|
@missing = grep { $_ !~ $missing_ignore } @missing; |
|
0
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# I'm getting sick of making MANIFEST.SKIP files just for the |
46
|
|
|
|
|
|
|
# .shipit conf file and dh-make-perl stuff, so let's ignore those |
47
|
0
|
|
|
|
|
|
my %ignore = map { $_ => 1 } qw( |
|
0
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
.shipit |
49
|
|
|
|
|
|
|
install-stamp |
50
|
|
|
|
|
|
|
build-stamp |
51
|
|
|
|
|
|
|
); |
52
|
0
|
|
0
|
|
|
|
@extra = grep { ! ($ignore{$_} || /^\.git/) } @extra; |
|
0
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
my $list = sub { |
55
|
0
|
|
|
0
|
|
|
join('', map { "$_\n" } @_); |
|
0
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
}; |
57
|
|
|
|
|
|
|
|
58
|
0
|
0
|
|
|
|
|
die "Missing files in MANIFEST, not on disk:\n\n" . $list->(@missing) if @missing; |
59
|
0
|
0
|
|
|
|
|
die "Extra files on disk, not in MANIFEST:\n\n" . $list->(@extra) if @extra; |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
return 1; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub makedist { |
65
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
66
|
0
|
|
|
|
|
|
$self->prepare_build; |
67
|
|
|
|
|
|
|
|
68
|
0
|
0
|
|
|
|
|
my $file = make_var("DISTVNAME") or die "No DISTVNAME in Makefile"; |
69
|
0
|
|
|
|
|
|
$file .= ".tar.gz"; |
70
|
0
|
0
|
|
|
|
|
die "Distfile $file already exists.\n" if -e $file; |
71
|
|
|
|
|
|
|
|
72
|
0
|
0
|
|
|
|
|
$self->run_build("dist") or die "make dist failed"; |
73
|
0
|
0
|
|
|
|
|
die "Distfile $file doesn't exists, but should.\n" unless -e $file; |
74
|
0
|
|
|
|
|
|
return $file; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |
78
|
|
|
|
|
|
|
|