Skip to content

Commit f28fefd

Browse files
committed
make com.dbg binary optional
1 parent 4724b21 commit f28fefd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/Perl/Dist/APPerl.pm

+7-2
Original file line numberDiff line numberDiff line change
@@ -1072,11 +1072,14 @@ sub Build {
10721072
};
10731073
$copyexe->($PERL_APE, $APPPATH);
10741074
my $srcdbg = "$PERL_APE.dbg";
1075-
if(! -f $srcdbg) {
1075+
for(1..2) {
1076+
if(-f $srcdbg) {
1077+
$copyexe->($srcdbg, "$APPPATH.dbg");
1078+
last;
1079+
}
10761080
$srcdbg = $PERL_APE;
10771081
$srcdbg =~ s/com$/elf/;
10781082
}
1079-
$copyexe->($srcdbg, "$APPPATH.dbg");
10801083
if((! exists $UserProjectConfig->{nobuild_perl_bin}) || scalar(keys %{$itemconfig->{zip_extra_files}})) {
10811084
print "cd $ZIP_ROOT\n";
10821085
chdir($ZIP_ROOT) or die "failed to enter ziproot";
@@ -1188,6 +1191,7 @@ sub Build {
11881191

11891192
foreach my $file ('perl.com', 'perl.com.dbg') {
11901193
my $srcpath = "$TEMPDIR/$file";
1194+
-e $srcpath or next;
11911195
my $destpath = "$OUTPUTDIR/$file";
11921196
print "mv $srcpath $destpath\n";
11931197
move($srcpath, $destpath) or die "move failed: $!";
@@ -1201,6 +1205,7 @@ sub Build {
12011205
my $destfile = $itemconfig->{dest};
12021206
$destfile .= '.dbg' if ($srcfile =~ /dbg$/);
12031207
my @args = ("$UserProjectConfig->{apperl_output}/$CurAPPerlName/$srcfile", $destfile);
1208+
-e $args[0] or next;
12041209
print 'cp '.join(' ', @args)."\n";
12051210
cp(@args) or die "copy failed: $!";
12061211
}

0 commit comments

Comments
 (0)