From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id B842A1F462 for ; Sat, 15 Jun 2019 18:35:29 +0000 (UTC) Received: from localhost ([::1]:35196 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcDWS-00068I-Jh for normalperson@yhbt.net; Sat, 15 Jun 2019 14:35:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44579) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcDWO-0005yg-1v for bug-gnulib@gnu.org; Sat, 15 Jun 2019 14:35:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcDWM-0002qS-6U for bug-gnulib@gnu.org; Sat, 15 Jun 2019 14:35:23 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:45118) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hcDWL-0002dv-3b for bug-gnulib@gnu.org; Sat, 15 Jun 2019 14:35:22 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2D89416190A; Sat, 15 Jun 2019 11:35:16 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id RniGVYwbTDa6; Sat, 15 Jun 2019 11:35:14 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A92F616190F; Sat, 15 Jun 2019 11:35:14 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id HZo-R2EySfjo; Sat, 15 Jun 2019 11:35:14 -0700 (PDT) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 55CF21618F0; Sat, 15 Jun 2019 11:35:14 -0700 (PDT) Subject: Re: Alpine: useless-if-before-free: Exec format error To: Bruno Haible References: <365b73af-3fb2-bd69-e3a2-3cc4cebc4ef9@gmx.de> <45902125.zfeXSMVeiH@omega> <7e57b669-5700-a9f1-b9dd-2c80009584dc@cs.ucla.edu> <2755553.BK5KSAcaQk@omega> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <054b026a-cd8e-7cb1-abb2-5bc504efcfe8@cs.ucla.edu> Date: Sat, 15 Jun 2019 11:35:13 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <2755553.BK5KSAcaQk@omega> Content-Type: multipart/mixed; boundary="------------102F45A9D67792EF296BFDE4" Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Blake , =?UTF-8?Q?Tim_R=c3=bchsen?= , bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" This is a multi-part message in MIME format. --------------102F45A9D67792EF296BFDE4 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for looking into and fixing that. One quibble: those long comments are probably more trouble than they're worth. I found that they got in the way of my understanding the code, as my eyes glazed over when reading them. And when I finally forced myself to read one, I found that at least one important detail was missing: the "#! -*-perl-*-" line is not just there for Emacs, but is also there for Perl. Instead of adding even more length to a comment that is already a bit of an obstacle to understanding the code, I suggest we just cite perlrun's man page as in the attached proposed patch. This should be good enough for anyone who's not already versed in perl+sh. --------------102F45A9D67792EF296BFDE4 Content-Type: text/x-patch; name="0001-Use-shorter-perlrun-comment.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Use-shorter-perlrun-comment.patch" >From 7969fe73da89ac372c681dca7839b880b59767f1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 15 Jun 2019 11:27:52 -0700 Subject: [PATCH] Use shorter perlrun comment * build-aux/announce-gen, build-aux/gitlog-to-changelog: * build-aux/prefix-gnulib-mk, build-aux/update-copyright: * build-aux/useless-if-before-free, tests/test-update-copyright.sh: Just cite perlrun(1) in the comment. --- ChangeLog | 8 ++++++++ build-aux/announce-gen | 13 +------------ build-aux/gitlog-to-changelog | 13 +------------ build-aux/prefix-gnulib-mk | 13 +------------ build-aux/update-copyright | 13 +------------ build-aux/useless-if-before-free | 13 +------------ tests/test-update-copyright.sh | 13 +------------ 7 files changed, 14 insertions(+), 72 deletions(-) diff --git a/ChangeLog b/ChangeLog index a0d2f415f..77e66c0e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2019-06-15 Paul Eggert + + Use shorter perlrun comment + * build-aux/announce-gen, build-aux/gitlog-to-changelog: + * build-aux/prefix-gnulib-mk, build-aux/update-copyright: + * build-aux/useless-if-before-free, tests/test-update-copyright.sh: + Just cite perlrun(1) in the comment. + 2019-06-15 Bruno Haible Fix scripts to have valid executable format on Alpine Linux. diff --git a/build-aux/announce-gen b/build-aux/announce-gen index b5728338c..1e2648d0e 100755 --- a/build-aux/announce-gen +++ b/build-aux/announce-gen @@ -1,17 +1,6 @@ #!/bin/sh #! -*-perl-*- -# This is a prologue that allows to run a perl script as an executable -# on systems that are compliant to a POSIX version before POSIX:2017. -# On such systems, the usual invocation of an executable through execlp() -# or execvp() fails with ENOEXEC if it is a script that does not start -# with a #! line. The script interpreter mentioned in the #! line has -# to be /bin/sh, because on GuixSD systems that is the only program that -# has a fixed file name. The second line is for editing this file in -# Emacs. The next two lines below are valid code in both sh and perl. -# When executed by sh, they re-execute the script through the perl -# program found in $PATH. The '-x' option is essential; without it, -# perl would re-execute the script through /bin/sh. When executed by -# perl, the next two lines are a no-op. +# Either perl or sh can run this file; see perlrun(1). eval 'exec perl -wSx "$0" "$@"' if 0; diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog index a616b8234..68722bacb 100755 --- a/build-aux/gitlog-to-changelog +++ b/build-aux/gitlog-to-changelog @@ -1,17 +1,6 @@ #!/bin/sh #! -*-perl-*- -# This is a prologue that allows to run a perl script as an executable -# on systems that are compliant to a POSIX version before POSIX:2017. -# On such systems, the usual invocation of an executable through execlp() -# or execvp() fails with ENOEXEC if it is a script that does not start -# with a #! line. The script interpreter mentioned in the #! line has -# to be /bin/sh, because on GuixSD systems that is the only program that -# has a fixed file name. The second line is for editing this file in -# Emacs. The next two lines below are valid code in both sh and perl. -# When executed by sh, they re-execute the script through the perl -# program found in $PATH. The '-x' option is essential; without it, -# perl would re-execute the script through /bin/sh. When executed by -# perl, the next two lines are a no-op. +# Either perl or sh can run this file; see perlrun(1). eval 'exec perl -wSx "$0" "$@"' if 0; diff --git a/build-aux/prefix-gnulib-mk b/build-aux/prefix-gnulib-mk index 66e138b46..10871a286 100755 --- a/build-aux/prefix-gnulib-mk +++ b/build-aux/prefix-gnulib-mk @@ -1,17 +1,6 @@ #!/bin/sh #! -*-perl-*- -# This is a prologue that allows to run a perl script as an executable -# on systems that are compliant to a POSIX version before POSIX:2017. -# On such systems, the usual invocation of an executable through execlp() -# or execvp() fails with ENOEXEC if it is a script that does not start -# with a #! line. The script interpreter mentioned in the #! line has -# to be /bin/sh, because on GuixSD systems that is the only program that -# has a fixed file name. The second line is for editing this file in -# Emacs. The next two lines below are valid code in both sh and perl. -# When executed by sh, they re-execute the script through the perl -# program found in $PATH. The '-x' option is essential; without it, -# perl would re-execute the script through /bin/sh. When executed by -# perl, the next two lines are a no-op. +# Either perl or sh can run this file; see perlrun(1). eval 'exec perl -wSx "$0" "$@"' if 0; diff --git a/build-aux/update-copyright b/build-aux/update-copyright index fa9d427e9..445c9cb06 100755 --- a/build-aux/update-copyright +++ b/build-aux/update-copyright @@ -1,17 +1,6 @@ #!/bin/sh #! -*-perl-*- -# This is a prologue that allows to run a perl script as an executable -# on systems that are compliant to a POSIX version before POSIX:2017. -# On such systems, the usual invocation of an executable through execlp() -# or execvp() fails with ENOEXEC if it is a script that does not start -# with a #! line. The script interpreter mentioned in the #! line has -# to be /bin/sh, because on GuixSD systems that is the only program that -# has a fixed file name. The second line is for editing this file in -# Emacs. The next two lines below are valid code in both sh and perl. -# When executed by sh, they re-execute the script through the perl -# program found in $PATH. The '-x' option is essential; without it, -# perl would re-execute the script through /bin/sh. When executed by -# perl, the next two lines are a no-op. +# Either perl or sh can run this file; see perlrun(1). eval 'exec perl -wSx "$0" "$@"' if 0; diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free index 0701e7b20..36ff86409 100755 --- a/build-aux/useless-if-before-free +++ b/build-aux/useless-if-before-free @@ -1,17 +1,6 @@ #!/bin/sh #! -*-perl-*- -# This is a prologue that allows to run a perl script as an executable -# on systems that are compliant to a POSIX version before POSIX:2017. -# On such systems, the usual invocation of an executable through execlp() -# or execvp() fails with ENOEXEC if it is a script that does not start -# with a #! line. The script interpreter mentioned in the #! line has -# to be /bin/sh, because on GuixSD systems that is the only program that -# has a fixed file name. The second line is for editing this file in -# Emacs. The next two lines below are valid code in both sh and perl. -# When executed by sh, they re-execute the script through the perl -# program found in $PATH. The '-x' option is essential; without it, -# perl would re-execute the script through /bin/sh. When executed by -# perl, the next two lines are a no-op. +# Either perl or sh can run this file; see perlrun(1). eval 'exec perl -wSx "$0" "$@"' if 0; diff --git a/tests/test-update-copyright.sh b/tests/test-update-copyright.sh index 9ef5344ea..30e7090b7 100755 --- a/tests/test-update-copyright.sh +++ b/tests/test-update-copyright.sh @@ -39,18 +39,7 @@ s=$TMP-script cat <<\EOF > $s #!/bin/sh #! -*-perl-*- -# This is a prologue that allows to run a perl script as an executable -# on systems that are compliant to a POSIX version before POSIX:2017. -# On such systems, the usual invocation of an executable through execlp() -# or execvp() fails with ENOEXEC if it is a script that does not start -# with a #! line. The script interpreter mentioned in the #! line has -# to be /bin/sh, because on GuixSD systems that is the only program that -# has a fixed file name. The second line is for editing this file in -# Emacs. The next two lines below are valid code in both sh and perl. -# When executed by sh, they re-execute the script through the perl -# program found in $PATH. The '-x' option is essential; without it, -# perl would re-execute the script through /bin/sh. When executed by -# perl, the next two lines are a no-op. +# Either perl or sh can run this file; see perlrun(1). eval 'exec perl -wSx "$0" "$@"' if 0; -- 2.21.0 --------------102F45A9D67792EF296BFDE4--