[LyX/master] Cmake export tests: Select "-dALLOWPSTRANSPARENCY" flag for ps2pdf converter

Kornel Benko kornel at lyx.org
Sun May 30 18:14:43 UTC 2021


commit bc01f50955536e66cda80ad1bb4b02488b1e5a59
Author: Kornel Benko <kornel at lyx.org>
Date:   Sun May 30 20:24:42 2021 +0200

    Cmake export tests: Select "-dALLOWPSTRANSPARENCY" flag for ps2pdf converter
    
    Add parameter "-dALLOWPSTRANSPARENCY" for call to ps2pdf.
    Used only in test environment.
    The fix is proposed by Scott.
    
    Here his comment:
            "Interestingly, the flag fixes the English Powerdot tests but not the
            French ones."
---
 lib/scripts/prefTest.pm |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/lib/scripts/prefTest.pm b/lib/scripts/prefTest.pm
index e98ac4a..8e25b79 100644
--- a/lib/scripts/prefTest.pm
+++ b/lib/scripts/prefTest.pm
@@ -87,17 +87,24 @@ sub getConverter($$)
   chomp($l);
   my ($from, $to, $cmd, $par);
   ($l, $from) = getNext($l);
-  return undef if ($from !~ /(tex|dvi)$/);
+  return undef if ($from !~ /(ps|tex|dvi)$/);
   ($l, $to) = getNext($l);
   return undef if ($to !~ /^((dvi3?|pdf[23456]?)(log)?)$/);
-  my ($checkfor, $substitute);
+  my ($checkfor, $substitute, $extrapar);
   if ($from =~ /tex/) {
     $checkfor = qr/\s+\-shell\-(escape|restricted)/;
     $substitute = "-shell-escape";
+    $extrapar = qr/^latex/;
+  }
+  elsif ($from =~ /ps$/) {
+    $checkfor = qr/\s+\-dALLOWPSTRANSPARENCY/;
+    $substitute = "-dALLOWPSTRANSPARENCY";
+    $extrapar = qr/hyperref-driver=dvips/;
   }
   else {
     $checkfor = qr/\s+-i\s+dvipdfmx-unsafe.cfg/;
     $substitute = "-i dvipdfmx-unsafe.cfg";
+    $extrapar = qr/^hyperref-driver=dvipdfm/;
   }
   ($l, $cmd) = getNext($l);
   if ($add) {
@@ -112,7 +119,7 @@ sub getConverter($$)
     $cmd =~ s/$checkfor//;
   }
   ($l, $par) = getNext($l);
-  return undef if ($par !~ /^(latex|hyperref-driver=dvipdfm)/);
+  return undef if ($par !~ $extrapar);
   my $key = "\"$from\" \"$to\"";
   if ($add) {
     return([$key, [$cmd, $par]]);


More information about the lyx-cvs mailing list