Skip to content

Commit fb6af8c

Browse files
committed
Attempt to warn about cpanm fails to install
1 parent 686b60e commit fb6af8c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{{$NEXT}}
33

44
* Create p5stack directory if missing (Issue#2, reported by AMBS++).
5+
* Attempt to warn about cpanm misses (Issue#3, reported by AMBS++).
56

67
0.003 2015-11-19 22:29:12+00:00 Europe/Lisbon
78

lib/App/p5stack.pm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ sub _do_setup {
104104
$self->_do_install_perl_release;
105105

106106
system "curl -s -L https://cpanmin.us | $self->{perl} - -l $self->{local_lib} --reinstall --no-sudo App::cpanminus local::lib > $self->{log_file} 2>&1";
107+
$self->{cpanm_flag} = $? >> 8;
107108

108109
_log("Getting dependencies info using '$self->{deps}' ...");
109110
_log('Installing dependencies ...');
@@ -118,6 +119,7 @@ sub _do_setup {
118119
exit;
119120
}
120121
system "$dzil listdeps | $cpanm --no-sudo -l $self->{local_lib}";
122+
$self->{cpanm_flag} = $? >> 8;
121123
}
122124
if ($self->{deps} eq 'cpanfile') {
123125
unless (-e catfile($self->{home},'cpanfile')) {
@@ -127,6 +129,9 @@ sub _do_setup {
127129
$self->_do_cpanm("--installdeps .");
128130
}
129131

132+
if ($self->{cpanm_flag}) {
133+
print "[p5stack] Warning, cpanm may have failed to install something!\n";
134+
}
130135
print "[p5stack] Setup done, use 'p5stack perl' to run your application.\n";
131136
}
132137

@@ -198,6 +203,7 @@ sub _do_cpanm {
198203
my $run = join ' ', $cpanm, "--no-sudo", "-L $self->{local_lib}", @args, $log;
199204

200205
system $run;
206+
$self->{cpanm_flag} = $? >> 8;
201207
}
202208

203209
sub _do_bin {

0 commit comments

Comments
 (0)