deri pushed a commit to branch master
in repository groff.

commit 72911e55b7b99edbc80055ec9a59d1d9ab30ba15
Author: Deri James <[email protected]>
AuthorDate: Tue Nov 4 17:25:54 2025 +0000

    [gropdf]: Reinstate -W to set exit code 2 on warning, and
    downgrade two Warnings to Notices.
    
    * src/devices/gropdf/gropdf.pl: Do it.
    
    Fixes https://savannah.gnu.org/bugs/?67612
    
    Thanks to Dave and Branden.
---
 ChangeLog                    | 11 +++++++++++
 src/devices/gropdf/gropdf.pl | 13 +++++++------
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 82e27dc44..3f2075e2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2025-11-04  Deri James  <[email protected]>
+
+       [gropdf]: Reinstate -W to set exit code 2 on warning, and
+       downgrade two Warnings to Notices.
+
+       * src/devices/gropdf/gropdf.pl: Do it.
+
+       Fixes https://savannah.gnu.org/bugs/?67612
+
+       Thanks to Dave and Branden.
+
 2025-11-04  Deri James  <[email protected]>
 
        Reinstate using -W flag when building pdfs. Baby was thrown
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index 7df03c2fb..28f41527a 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -225,6 +225,7 @@ my $gotzlib=0;
 my $gotinline=0;
 my $gotexif=0;
 my $xitcd=0;
+my $warnexit=0;
 
 my $rc = eval
 {
@@ -450,8 +451,8 @@ sub usage
     my $had_error = shift;
     $stream = *STDERR if $had_error;
     print $stream
-"usage: $prog [-dels] [-F font-directory] [-I inclusion-directory]" .
-" [-p paper-format] [-u [cmap-file]] [-y foundry] [file ...]\n" .
+"usage: $prog [-delsW] [-F font-directory] [-I inclusion-directory]" .
+" [--opt advanced-opts] [-p paper-format] [--pdfver 1.4|1.7] [-u [cmap-file]] 
[-y foundry] [file ...]\n" .
 "usage: $prog {-v | --version}\n" .
 "usage: $prog --help\n";
     if (!$had_error)
@@ -494,7 +495,7 @@ my $parclntyp=qr/(?:[\d\w]|\([+-]?[\S]{2}|$parcln)/;
 if (!GetOptions('F=s' => \@fdlist, 'I=s' => \@idirs, 'l' => \$frot,
     'p=s' => \$fpsz, 'd!' => \$debug, 'help' => \$want_help, 'pdfver=f' => 
\$PDFver,
     'v' => \$version, 'version' => \$version, 'opt=s' => \$options,
-    'e' => \$embedall, 'y=s' => \$Foundry, 's' => \$stats,
+    'e' => \$embedall, 'y=s' => \$Foundry, 's' => \$stats, 'W' => \$warnexit,
     'u:s' => \$unicodemap))
 {
     &usage(1);
@@ -532,7 +533,7 @@ if (defined($unicodemap))
 
 if ($PDFver != 1.4 and $PDFver != 1.7)
 {
-    Warn("Only pdf versions 1.4 or 1.7 are supported, not '$PDFver'");
+    Notice("Only pdf versions 1.4 or 1.7 are supported, not '$PDFver'");
     $PDFver=1.7;
 }
 
@@ -3190,7 +3191,7 @@ sub Warn
     unshift(@_, "warning: ");
     my $msg=join('',@_);
     Msg(0,$msg);
-    $xitcd=2;
+    $xitcd=2 if $warnexit;
 }
 
 sub Die
@@ -3508,7 +3509,7 @@ sub LoadFont
     $fnt{t1flags}=$t1flags;
     my $fontkey="$foundry $fnt{internalname}";
 
-    Warn("\nFont '$fnt{internalname} ($ofontnm)' has $lastchr glyphs\n"
+    Notice("\nFont '$fnt{internalname} ($ofontnm)' has $lastchr glyphs\n"
        ."You would see a noticeable speedup if you install the perl module 
Inline::C\n") if !$gotinline and $lastchr > 1000;
 
     if (exists($download{$fontkey}))

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to