line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package My::SVN::Builder; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use File::Basename; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
221
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
6
|
use base 'Module::Build'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
166372
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
235229
|
use Cwd; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
107
|
|
8
|
1
|
|
|
1
|
|
8
|
use Config; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1150
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub _run { |
11
|
1
|
|
|
1
|
|
7
|
my($self, $prog, @args) = @_; |
12
|
|
|
|
|
|
|
|
13
|
1
|
50
|
|
|
|
35
|
$prog = $self->notes('your_make') if $prog eq 'make'; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
42
|
print "Running $prog @args\n"; |
16
|
1
|
50
|
|
|
|
12254
|
return system($prog, @args) == 0 ? 1 : 0; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my $Orig_CWD = cwd; |
20
|
|
|
|
|
|
|
sub _chdir_to_svn { |
21
|
2
|
100
|
|
2
|
|
780
|
chdir 'src/subversion' or die $!; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _chdir_to_native { |
25
|
1
|
|
|
1
|
|
11
|
_chdir_to_svn; |
26
|
0
|
0
|
|
|
|
0
|
chdir "subversion/bindings/swig/perl/native" or die $!; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub _chdir_back { |
30
|
0
|
|
|
0
|
|
0
|
chdir $Orig_CWD; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _svn_provides { |
35
|
0
|
|
|
0
|
|
0
|
my $class = shift; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
0
|
my @pms = ; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
0
|
my %provides; |
40
|
0
|
|
|
|
|
0
|
for my $pm (@pms) { |
41
|
0
|
|
|
|
|
0
|
my $module = 'SVN::' . basename($pm, ".pm"); |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
0
|
$provides{$module} = { file => $pm }; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
0
|
$provides{"SVN::Core"}{version} = '1.7.17'; |
47
|
0
|
|
|
|
|
0
|
$provides{"Alien::SVN"} = { |
48
|
|
|
|
|
|
|
version => '1.7.17.1', |
49
|
|
|
|
|
|
|
file => 'lib/Alien/SVN.pm' |
50
|
|
|
|
|
|
|
}; |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
0
|
_chdir_back; |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
0
|
return \%provides; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
my %build_to_makemaker = ( |
59
|
|
|
|
|
|
|
# Some names they have in common |
60
|
|
|
|
|
|
|
map {lc($_) => $_} qw(DESTDIR PREFIX INSTALL_BASE UNINST INSTALLDIRS), |
61
|
|
|
|
|
|
|
); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
my %translate_values = ( |
64
|
|
|
|
|
|
|
installdirs => { |
65
|
|
|
|
|
|
|
core => "perl", |
66
|
|
|
|
|
|
|
site => 'site', |
67
|
|
|
|
|
|
|
vendor => 'vendor' |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
); |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub _makemaker_args { |
72
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
0
|
my $props = $self->{properties}; |
75
|
0
|
|
|
|
|
0
|
my %mm_args; |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
0
|
for my $key (keys %build_to_makemaker) { |
78
|
0
|
0
|
|
|
|
0
|
next unless defined $props->{$key}; |
79
|
0
|
|
|
|
|
0
|
my $value = $props->{$key}; |
80
|
0
|
0
|
|
|
|
0
|
$value = $translate_values{$key}{$value} if $translate_values{$key}; |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
|
|
0
|
$mm_args{$build_to_makemaker{$key}} = $value; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
0
|
|
|
|
|
0
|
return map { "$_=$mm_args{$_}" } keys %mm_args; |
|
0
|
|
|
|
|
0
|
|
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub _default_configure_args { |
89
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
90
|
|
|
|
|
|
|
|
91
|
0
|
|
|
|
|
0
|
my $props = $self->{properties}; |
92
|
0
|
|
0
|
|
|
0
|
my $prefix = $props->{install_base} || |
93
|
|
|
|
|
|
|
$props->{prefix} || |
94
|
|
|
|
|
|
|
$Config{siteprefix}; |
95
|
|
|
|
|
|
|
|
96
|
0
|
|
|
|
|
0
|
my %args = ( |
97
|
|
|
|
|
|
|
'--prefix' => $prefix, |
98
|
|
|
|
|
|
|
'--libdir' => File::Spec->catdir( |
99
|
|
|
|
|
|
|
$self->install_destination('arch'), 'Alien', 'SVN' |
100
|
|
|
|
|
|
|
), |
101
|
|
|
|
|
|
|
PERL => $^X, |
102
|
|
|
|
|
|
|
); |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
0
|
return join ' ', map { "$_=$args{$_}" } sort keys %args; |
|
0
|
|
|
|
|
0
|
|
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub _run_svn_configure { |
108
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
109
|
|
|
|
|
|
|
|
110
|
0
|
|
|
|
|
0
|
_chdir_to_svn; |
111
|
|
|
|
|
|
|
|
112
|
0
|
|
|
|
|
0
|
my $ok = $self->_run("sh configure @{[$self->notes('configure_args')]}"); |
|
0
|
|
|
|
|
0
|
|
113
|
|
|
|
|
|
|
|
114
|
0
|
|
|
|
|
0
|
_chdir_back; |
115
|
|
|
|
|
|
|
|
116
|
0
|
0
|
|
|
|
0
|
return 1 if $ok; |
117
|
|
|
|
|
|
|
|
118
|
0
|
|
|
|
|
0
|
warn "configuring SVN failed"; |
119
|
0
|
|
|
|
|
0
|
return 0; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
sub ACTION_code { |
123
|
1
|
|
|
1
|
0
|
147
|
my $self = shift; |
124
|
|
|
|
|
|
|
|
125
|
1
|
|
|
|
|
33
|
$self->SUPER::ACTION_code; |
126
|
|
|
|
|
|
|
|
127
|
1
|
|
|
|
|
11068
|
_chdir_to_svn; |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
$self->_run('make') |
130
|
1
|
50
|
|
|
|
9
|
or do { warn "building subversion failed"; return 0 }; |
|
1
|
|
|
|
|
104
|
|
|
1
|
|
|
|
|
36
|
|
131
|
|
|
|
|
|
|
$self->_run("make swig-pl-lib") |
132
|
0
|
0
|
|
|
|
0
|
or do { warn "building swig-pl-lib failed"; return 0 }; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
133
|
|
|
|
|
|
|
|
134
|
0
|
|
|
|
|
0
|
_chdir_back; |
135
|
0
|
|
|
|
|
0
|
_chdir_to_native; |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
$self->_run($^X, "Makefile.PL", $self->_makemaker_args) |
138
|
0
|
0
|
|
|
|
0
|
or do { warn "running Makefile.PL failed"; return 0 }; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
139
|
0
|
0
|
|
|
|
0
|
$self->_run("make") or do { warn "building SV::Core failed"; return 0 }; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
140
|
|
|
|
|
|
|
|
141
|
0
|
|
|
|
|
0
|
_chdir_back; |
142
|
0
|
|
|
|
|
0
|
_chdir_to_svn; |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
$self->_run("make swig-pl") |
145
|
0
|
0
|
|
|
|
0
|
or do { warn "building swig-pl failed"; return 0 }; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
146
|
|
|
|
|
|
|
|
147
|
0
|
|
|
|
|
0
|
_chdir_back; |
148
|
|
|
|
|
|
|
|
149
|
0
|
|
|
|
|
0
|
return 1; |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
sub ACTION_test { |
154
|
1
|
|
|
1
|
0
|
182
|
my $self = shift; |
155
|
|
|
|
|
|
|
|
156
|
1
|
|
|
|
|
32
|
$self->depends_on('code'); |
157
|
|
|
|
|
|
|
|
158
|
1
|
|
|
|
|
103
|
_chdir_to_native; |
159
|
|
|
|
|
|
|
|
160
|
0
|
|
|
|
|
|
my $test_status = $self->_run("make test"); |
161
|
|
|
|
|
|
|
|
162
|
0
|
|
|
|
|
|
_chdir_back; |
163
|
|
|
|
|
|
|
|
164
|
0
|
|
|
|
|
|
return $test_status; |
165
|
|
|
|
|
|
|
} |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
sub ACTION_install { |
169
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
170
|
|
|
|
|
|
|
|
171
|
0
|
|
|
|
|
|
_chdir_to_svn; |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
$self->_run("make install-lib") |
174
|
0
|
0
|
|
|
|
|
or do { warn "installing libs failed"; return 0 }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
$self->_run("make install-swig-pl-lib") |
177
|
0
|
0
|
|
|
|
|
or do { warn "installing swig-pl-lib failed"; return 0 }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
|
179
|
0
|
|
|
|
|
|
_chdir_back; |
180
|
0
|
|
|
|
|
|
_chdir_to_native; |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
$self->_run("make install") |
183
|
0
|
0
|
|
|
|
|
or do { warn "installing SVN::Core failed"; return 0 }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
|
185
|
0
|
|
|
|
|
|
_chdir_back; |
186
|
|
|
|
|
|
|
|
187
|
0
|
|
|
|
|
|
$self->SUPER::ACTION_install; |
188
|
|
|
|
|
|
|
} |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
1; |
191
|
|
|
|
|
|
|
|