Skip to content

Commit 08a9e07

Browse files
committed
fix perl build
1 parent 9cff3d4 commit 08a9e07

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

lib/App/p5stack.pm

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ sub new {
1919
my $self = bless {}, $class;
2020

2121
$self->{orig_argv} = [ @argv ];
22-
22+
2323
## treat flags only if before the "command"
2424
while (@argv && $argv[0] =~ /^-/) {
2525
$self->_activate_flag(shift @argv)
@@ -28,11 +28,11 @@ sub new {
2828
$self->{command} = @argv ? lc shift @argv : '';
2929

3030
$self->{argv} = [ @argv ];
31-
31+
3232
# handle config
3333
$self->_do_config;
3434
$self->_dump_config if $self->{debug};
35-
35+
3636
return $self;
3737
}
3838

@@ -129,14 +129,14 @@ sub _do_setup {
129129
_log('Installing dependencies ...');
130130
my $cpanm = $self->_get_cpanm;
131131

132+
## Dist::Zilla logic
132133
if ($self->{deps} eq 'dzil') {
133-
134134
unless (-e catfile($self->{home},'dist.ini')) {
135135
_log('Configuration is set to use "dzil" to gather dependencies information, but no "dist.ini" file was found in current directory.. exiting.');
136136
exit;
137137
}
138138

139-
my $dzil = which 'dzil';
139+
my $dzil = which 'dzil'; ## FIXME: shouldn't we look for a local dzil, or is it irrelevant?
140140
if ($dzil) {
141141
system "$dzil listdeps | $cpanm --no-sudo -l $self->{local_lib}";
142142
$self->{cpanm_flag} = $? >> 8;
@@ -149,8 +149,10 @@ sub _do_setup {
149149
$self->{cpanm_flag} = $? >> 8;
150150
}
151151
}
152+
153+
## cpanfile logic
152154
if ($self->{deps} eq 'cpanfile') {
153-
unless (-e catfile($self->{home},'cpanfile')) {
155+
unless (-e catfile($self->{home}, 'cpanfile')) {
154156
_log('Configuration is set to use "cpanfile" to gather dependencies information, but no "cpanfile" file was found in current directory.. exiting.');
155157
exit;
156158
}
@@ -206,7 +208,7 @@ sub _do_install_perl_release {
206208
Archive::Tar->extract_archive($file);
207209

208210
chdir catfile($self->{perls_root}, "perl-$self->{perl_version}");
209-
211+
210212
_log("Configuring $self->{perl_version} release ...");
211213
my $prefix = catfile($self->{perls_root}, $self->{perl_version});
212214
system "sh Configure -de -Dprefix=$prefix > $self->{log_file} 2>&1";
@@ -220,6 +222,7 @@ sub _do_install_perl_release {
220222
_log("Installing $self->{perl_version} release ...");
221223
system "make install >> $self->{log_file} 2>&1";
222224

225+
chdir $curr; # go back
223226
}
224227

225228
sub _do_perl {

0 commit comments

Comments
 (0)