Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 232d7868

Von Bernd Bleßmann vor mehr als 9 Jahren hinzugefügt

  • ID 232d78687663884df38c106f9089f637509722fd
  • Vorgänger d0b60417
  • Nachfolger d13c7050

Rückgabewert von system-Aufrufen prüfen und ggf. Fehler ausgeben.

Unterschiede anzeigen:

SL/Template/HTML.pm
$psfile .= ".ps";
}
system($::lx_office_conf{applications}->{html2ps} . " -f html2ps-config < $form->{tmpfile} > $psfile");
if (system($::lx_office_conf{applications}->{html2ps} . " -f html2ps-config < $form->{tmpfile} > $psfile") == -1) {
die "system call to $::lx_office_conf{applications}->{html2ps} failed: $!";
}
if ($?) {
$self->{"error"} = $form->cleanup($::lx_office_conf{applications}->{html2ps});
return 0;
......
$pdffile .= ".pdf";
}
system($::lx_office_conf{applications}->{html2ps} . " -f html2ps-config < $form->{tmpfile} | ps2pdf - $pdffile");
if (system($::lx_office_conf{applications}->{html2ps} . " -f html2ps-config < $form->{tmpfile} | ps2pdf - $pdffile") == -1) {
die "system call to $::lx_office_conf{applications}->{html2ps} failed: $!";
}
if ($?) {
$self->{"error"} = $form->cleanup($::lx_office_conf{applications}->{html2ps});
return 0;
SL/Template/LaTeX.pm
$ENV{openin_any} = "p";
for (my $run = 1; $run <= 2; $run++) {
system("${latex} --interaction=nonstopmode $form->{tmpfile} " .
"> $form->{tmpfile}.err");
if (system("${latex} --interaction=nonstopmode $form->{tmpfile} " .
"> $form->{tmpfile}.err") == -1) {
die "system call to $latex failed: $!";
}
if ($?) {
$ENV{HOME} = $old_home;
$ENV{openin_any} = $old_openin_any;
......
$form->{tmpfile} =~ s/tex$/dvi/;
system("dvips $form->{tmpfile} -o -q > /dev/null");
if (system("dvips $form->{tmpfile} -o -q > /dev/null") == -1) {
die "system call to dvips failed: $!";
}
$ENV{HOME} = $old_home;
$ENV{openin_any} = $old_openin_any;
if ($?) {
$self->{"error"} = "dvips : $!";
$self->{"error"} = "dvips : $?";
$self->cleanup('dvips');
return 0;
}
......
$ENV{openin_any} = "p";
for (my $run = 1; $run <= 2; $run++) {
system("${latex} --interaction=nonstopmode $form->{tmpfile} " .
"> $form->{tmpfile}.err");
if (system("${latex} --interaction=nonstopmode $form->{tmpfile} " .
"> $form->{tmpfile}.err") == -1) {
die "system call to $latex failed: $!";
}
if ($?) {
$ENV{HOME} = $old_home;
$ENV{openin_any} = $old_openin_any;
SL/Template/OpenDocument.pm
$main::lxdebug->message(LXDebug->DEBUG2(), " xauthority $xauthority\n");
system("xauth add \"${display}\" . \"${mcookie}\"");
if (system("xauth add \"${display}\" . \"${mcookie}\"") == -1) {
die "system call to xauth failed: $!";
}
if ($? != 0) {
$self->{"error"} = "Conversion to PDF failed because OpenOffice could not be started (xauth: $!)";
$main::lxdebug->leave_sub();
......
}
if (!$::lx_office_conf{print_templates}->{openofficeorg_daemon}) {
system($::lx_office_conf{applications}->{openofficeorg_writer},
"-minimized", "-norestore", "-nologo", "-nolockcheck", "-headless",
"file:${filename}.odt",
"macro://" . (split('/', $filename))[-1] . "/Standard.Conversion.ConvertSelfToPDF()");
if (system($::lx_office_conf{applications}->{openofficeorg_writer},
"-minimized", "-norestore", "-nologo", "-nolockcheck", "-headless",
"file:${filename}.odt",
"macro://" . (split('/', $filename))[-1] . "/Standard.Conversion.ConvertSelfToPDF()") == -1) {
die "system call to $::lx_office_conf{applications}->{openofficeorg_writer} failed: $!";
}
} else {
if (!$self->spawn_openoffice()) {
$main::lxdebug->leave_sub();

Auch abrufbar als: Unified diff