groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 71/72: [devpdf,gropdf]: "use warnings" instead of '-w'.


From: G. Branden Robinson
Subject: [groff] 71/72: [devpdf,gropdf]: "use warnings" instead of '-w'.
Date: Sun, 23 Oct 2022 22:25:48 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 263d995a7d4e859a331e1a6441f3105ee743b824
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Oct 23 20:07:20 2022 -0500

    [devpdf,gropdf]: "use warnings" instead of '-w'.
    
    * font/devpdf/util/BuildFoundries.pl:
    * src/devices/gropdf/gropdf.pl:
    * src/devices/gropdf/pdfmom.pl: Replace use of '-w' in shebang line with
      "use warnings;".
    
    The shebang's max length is usually 128 as defined in
    /usr/include/linux/binfmts.h:
      #define BINPRM_BUF_SIZE 128
    
    There would be errors when @PERL@ is longer than 128, use
    '/usr/bin/env perl' can fix the problem, but '/usr/bin/env perl -w'
    doesn't work:
    
    /usr/bin/env: perl -w: No such file or directory
    
    So replace "perl -w" with "use warnings" to make it work.
    
    Reported-by: Alexander Kanavin <alex@linutronix.de>
    
    Note from Alex: the Yocto project has been carrying this patch for
    a few years, hope it's useful and acceptable. This submission is
    a part of 'patch cleanup' where we try to reduce the amount of custom
    patches by sending upstream what is appropriate.
---
 ChangeLog                          | 7 +++++++
 font/devpdf/util/BuildFoundries.pl | 3 ++-
 src/devices/gropdf/gropdf.pl       | 3 ++-
 src/devices/gropdf/pdfmom.pl       | 3 ++-
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ee031bc06..6c711f6f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-10-21  Robert Yang <liezhi.yang@windriver.com>
+
+       * font/devpdf/util/BuildFoundries.pl:
+       * src/devices/gropdf/gropdf.pl:
+       * src/devices/gropdf/pdfmom.pl: Replace use of '-w' in shebang
+       line with "use warnings;".
+
 2022-10-23  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/fallbacks.tmac: Define fallback characters for many code
diff --git a/font/devpdf/util/BuildFoundries.pl 
b/font/devpdf/util/BuildFoundries.pl
index b1af6b0f7..03f5eeebf 100644
--- a/font/devpdf/util/BuildFoundries.pl
+++ b/font/devpdf/util/BuildFoundries.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 #
 # BuildFoundries: Given a Foundry file, generate groff font description
 # files and a "download" file so gropdf can embed fonts in PDF output.
@@ -23,6 +23,7 @@
 
 use strict;
 use Getopt::Long;
+use warnings;
 
 my $pathsep='@PATH_SEPARATOR@';
 
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index fbf13b178..f7be222ab 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -1,4 +1,4 @@
-#!@PERL@ -w
+#!@PERL@
 #
 #       gropdf          : PDF post processor for groff
 #
@@ -21,6 +21,7 @@
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 use strict;
+use warnings;
 use Getopt::Long qw(:config bundling);
 
 use constant
diff --git a/src/devices/gropdf/pdfmom.pl b/src/devices/gropdf/pdfmom.pl
index 8e88c0763..89977d496 100644
--- a/src/devices/gropdf/pdfmom.pl
+++ b/src/devices/gropdf/pdfmom.pl
@@ -1,4 +1,4 @@
-#!@PERL@ -w
+#!@PERL@
 #
 #      pdfmom          : Frontend to run groff -mom to produce PDFs
 #      Deri James      : Friday 16 Mar 2012
@@ -23,6 +23,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 use strict;
+use warnings;
 use File::Temp qw/tempfile/;
 my @cmd;
 my $dev='pdf';



reply via email to

[Prev in Thread] Current Thread [Next in Thread]