All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Yang <liezhi.yang@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH 2/7] mc: replace "perl -w" with "use warnings"
Date: Thu, 6 Apr 2017 03:05:51 -0700	[thread overview]
Message-ID: <5202440801102f06224b3e7f2beda88364edd7ad.1491473008.git.liezhi.yang@windriver.com> (raw)
In-Reply-To: <cover.1491473008.git.liezhi.yang@windriver.com>

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@ (hostools/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.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 .../0001-mc-replace-perl-w-with-use-warnings.patch | 129 +++++++++++++++++++++
 meta/recipes-extended/mc/mc_4.8.18.bb              |   3 +
 2 files changed, 132 insertions(+)
 create mode 100644 meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch

diff --git a/meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch b/meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch
new file mode 100644
index 0000000000..bf8037cd28
--- /dev/null
+++ b/meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch
@@ -0,0 +1,129 @@
+From cdc7c278212ae836eecb4cc9d42c29443cc128a0 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 6 Apr 2017 02:24:28 -0700
+Subject: [PATCH] mc: replace "perl -w" 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.
+
+The man2hlp.in already has "use warnings;", so just remove '-w' is OK.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ src/man2hlp/man2hlp.in           | 2 +-
+ src/vfs/extfs/helpers/a+.in      | 4 +++-
+ src/vfs/extfs/helpers/mailfs.in  | 3 ++-
+ src/vfs/extfs/helpers/patchfs.in | 3 ++-
+ src/vfs/extfs/helpers/ulib.in    | 4 +++-
+ src/vfs/extfs/helpers/uzip.in    | 3 ++-
+ 6 files changed, 13 insertions(+), 6 deletions(-)
+
+diff --git a/src/man2hlp/man2hlp.in b/src/man2hlp/man2hlp.in
+index f095830..558a674 100644
+--- a/src/man2hlp/man2hlp.in
++++ b/src/man2hlp/man2hlp.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ #
+ #  Man page to help file converter
+ #  Copyright (C) 1994, 1995, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
+diff --git a/src/vfs/extfs/helpers/a+.in b/src/vfs/extfs/helpers/a+.in
+index 579441c..fe446f4 100644
+--- a/src/vfs/extfs/helpers/a+.in
++++ b/src/vfs/extfs/helpers/a+.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ #
+ # External filesystem for mc, using mtools
+ # Written Ludek Brukner <lubr@barco.cz>, 1997
+@@ -9,6 +9,8 @@
+ 
+ # These mtools components must be in PATH for this to work
+ 
++use warnings;
++
+ sub quote {
+     $_ = shift(@_);
+     s/([^\w\/.+-])/\\$1/g;
+diff --git a/src/vfs/extfs/helpers/mailfs.in b/src/vfs/extfs/helpers/mailfs.in
+index e9455be..059f41f 100644
+--- a/src/vfs/extfs/helpers/mailfs.in
++++ b/src/vfs/extfs/helpers/mailfs.in
+@@ -1,6 +1,7 @@
+-#! @PERL@ -w
++#! @PERL@
+ 
+ use bytes;
++use warnings;
+ 
+ # MC extfs for (possibly compressed) Berkeley style mailbox files
+ # Peter Daum <gator@cs.tu-berlin.de> (Jan 1998, mc-4.1.24)
+diff --git a/src/vfs/extfs/helpers/patchfs.in b/src/vfs/extfs/helpers/patchfs.in
+index ef407de..3ad4b53 100644
+--- a/src/vfs/extfs/helpers/patchfs.in
++++ b/src/vfs/extfs/helpers/patchfs.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ #
+ # Written by Adam Byrtek <alpha@debian.org>, 2002
+ # Rewritten by David Sterba <dave@jikos.cz>, 2009
+@@ -9,6 +9,7 @@
+ 
+ use bytes;
+ use strict;
++use warnings;
+ use POSIX;
+ use File::Temp 'tempfile';
+ 
+diff --git a/src/vfs/extfs/helpers/ulib.in b/src/vfs/extfs/helpers/ulib.in
+index 418611f..82c7ccf 100644
+--- a/src/vfs/extfs/helpers/ulib.in
++++ b/src/vfs/extfs/helpers/ulib.in
+@@ -1,9 +1,11 @@
+-#! @PERL@ -w
++#! @PERL@
+ #
+ # VFS to manage the gputils archives.
+ # Written by Molnár Károly (proton7@freemail.hu) 2012
+ #
+ 
++use warnings;
++
+ my %month = ('jan' => '01', 'feb' => '02', 'mar' => '03',
+              'apr' => '04', 'may' => '05', 'jun' => '06',
+              'jul' => '07', 'aug' => '08', 'sep' => '09',
+diff --git a/src/vfs/extfs/helpers/uzip.in b/src/vfs/extfs/helpers/uzip.in
+index b1c4f90..c8eb335 100644
+--- a/src/vfs/extfs/helpers/uzip.in
++++ b/src/vfs/extfs/helpers/uzip.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ #
+ # zip file archive Virtual File System for Midnight Commander
+ # Version 1.4.0 (2001-08-07).
+@@ -9,6 +9,7 @@
+ use POSIX;
+ use File::Basename;
+ use strict;
++use warnings;
+ 
+ #
+ # Configuration options
+-- 
+2.10.2
+
diff --git a/meta/recipes-extended/mc/mc_4.8.18.bb b/meta/recipes-extended/mc/mc_4.8.18.bb
index 78abb275ba..17f3f73af7 100644
--- a/meta/recipes-extended/mc/mc_4.8.18.bb
+++ b/meta/recipes-extended/mc/mc_4.8.18.bb
@@ -7,6 +7,7 @@ DEPENDS = "ncurses glib-2.0 util-linux"
 RDEPENDS_${PN} = "ncurses-terminfo"
 
 SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \
+           file://0001-mc-replace-perl-w-with-use-warnings.patch \
            "
 SRC_URI[md5sum] = "cc56f0c9abd63c4caa3636bba3a08bfb"
 SRC_URI[sha256sum] = "5b591e10dcbea95233434da40cdad4663d360229adf89826576c319667c103cb"
@@ -22,6 +23,8 @@ PACKAGECONFIG[sftp] = "--enable-vfs-sftp,--disable-vfs-sftp,libssh2,"
 
 EXTRA_OECONF = "--with-screen=ncurses --without-gpm-mouse --without-x"
 
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
+
 do_install_append () {
 	sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${libexecdir}/mc/extfs.d/*
 	sed -i -e '1s,#!.*python,#!${bindir}/env python,' ${D}${libexecdir}/mc/extfs.d/*
-- 
2.11.0.rc2.dirty



  parent reply	other threads:[~2017-04-06 10:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06 10:05 [PATCH 0/7 V2] fixes for building in long path (length = 410) Robert Yang
2017-04-06 10:05 ` [PATCH 1/7] groff: replace "perl -w" with "use warnings" Robert Yang
2017-04-06 10:05 ` Robert Yang [this message]
2017-04-06 10:05 ` [PATCH 3/7] valgrind: set ac_cv_path_PERL to /usr/bin/env perl Robert Yang
2017-04-06 10:05 ` [PATCH 4/7] m4: do_configure: fix "Argument list too long" Robert Yang
2017-04-06 10:05 ` [PATCH 5/7] guile: " Robert Yang
2017-04-06 10:05 ` [PATCH 6/7] autogen-native: fix POSIX_SHELL and perl Robert Yang
2017-04-06 10:05 ` [PATCH 7/7] kmod: set ac_cv_path_DOLT_BASH to /usr/bin/env bash Robert Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5202440801102f06224b3e7f2beda88364edd7ad.1491473008.git.liezhi.yang@windriver.com \
    --to=liezhi.yang@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.