Cmake export tests: Enable unsafe dvipdfmx

Add parameter "-i dvipdfmx-unsafe.cfg" for call to dvipdfmx.
Used only in test environment.
This is needed because of regression for ja LilyPond found by Scott.
Coment by Jürgen:
  "dvipdfmx-unsafe.cfg makes dvipdfmx call gs (rungs) with -dNOSAFER
  rather than with -DSAFER (as in the default dvipdfmx.cfg of TL21).

  However, this change should definitely only be applied to trustworthy
  files, so changing the converter generally is certainly not such a good
  idea."
This commit is contained in:
Kornel Benko 2021-05-23 10:05:13 +02:00
parent c6c6576515
commit 5158b54eb9

View File

@ -87,23 +87,32 @@ sub getConverter($$)
chomp($l);
my ($from, $to, $cmd, $par);
($l, $from) = getNext($l);
return undef if ($from !~ /tex$/);
return undef if ($from !~ /(tex|dvi)$/);
($l, $to) = getNext($l);
return undef if ($to !~ /^((dvi3?|pdf[23456]?)(log)?)$/);
my ($checkfor, $substitute);
if ($from =~ /tex/) {
$checkfor = qr/\s+\-shell\-(escape|restricted)/;
$substitute = "-shell-escape";
}
else {
$checkfor = qr/\s+-i\s+dvipdfmx-unsafe.cfg/;
$substitute = "-i dvipdfmx-unsafe.cfg";
}
($l, $cmd) = getNext($l);
if ($add) {
if ($cmd !~ /\-shell-(escape|restricted)/) {
if ($cmd !~ $checkfor) {
if ($cmd =~ /^(\S+)\s*(.*)$/) {
$cmd = "$1 -shell-escape $2";
$cmd = "$1 $substitute $2";
$cmd =~ s/\s+$//;
}
}
}
else {
$cmd =~ s/\s+\-shell\-(escape|restricted)//;
$cmd =~ s/$checkfor//;
}
($l, $par) = getNext($l);
return undef if ($par !~ /^latex/);
return undef if ($par !~ /^(latex|hyperref-driver=dvipdfm)/);
my $key = "\"$from\" \"$to\"";
if ($add) {
return([$key, [$cmd, $par]]);