bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Darshit Shah <darnir@gnu.org>
To: Bruno Haible <bruno@clisp.org>
Cc: "Tim Rühsen" <tim.ruehsen@gmx.de>,
	bug-gnulib@gnu.org, "Paul Eggert" <eggert@cs.ucla.edu>,
	"Eric Blake" <eblake@redhat.com>
Subject: Re: Alpine: useless-if-before-free: Exec format error
Date: Sat, 15 Jun 2019 13:25:55 +0200	[thread overview]
Message-ID: <20190615112555.dlpl33puu4knwxzt@tardis.localdomain> (raw)
In-Reply-To: <2755553.BK5KSAcaQk@omega>

[-- Attachment #1: Type: text/plain, Size: 2204 bytes --]

* Bruno Haible <bruno@clisp.org> [190615 13:07]:

> 2019-06-15  Bruno Haible  <bruno@clisp.org>
> 
> 	Fix scripts to have valid executable format on Alpine Linux.
> 	Reported by Tim Rühsen <tim.ruehsen@gmx.de>.
> 	Idea by Paul Eggert.
> 	* build-aux/useless-if-before-free: Use a prologue that starts with
> 	'#!/bin/sh'.
> 	* build-aux/announce-gen: Likewise.
> 	* build-aux/gitlog-to-changelog: Likewise.
> 	* build-aux/prefix-gnulib-mk: Likewise.
> 	* build-aux/update-copyright: Likewise.
> 	* tests/test-update-copyright.sh: Update test program accordingly.
> 
> diff --git a/build-aux/announce-gen b/build-aux/announce-gen
> index 0174f5c..b572833 100755
> --- a/build-aux/announce-gen
> +++ b/build-aux/announce-gen
> @@ -1,6 +1,20 @@
> -eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
> -  & eval 'exec perl -wS "$0" $argv:q'
> -    if 0;
> +#!/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.
> +eval 'exec perl -wSx "$0" "$@"'
> +     if 0;
> +
>  # Generate a release announcement message.
>  
>  my $VERSION = '2018-03-07 03:46'; # UTC

Won't this break the emacs timestamp hook which apparently needs to be within
the first eight lines of the file? Maybe either reduce the text, or move the
hooks around.


-- 
Thanking You,
Darshit Shah
PGP Fingerprint: 7845 120B 07CB D8D6 ECE5 FF2B 2A17 43ED A91A 35B6

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 894 bytes --]

  reply	other threads:[~2019-06-15 11:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 17:04 Alpine: useless-if-before-free: Exec format error Tim Rühsen
2019-06-14 17:50 ` Paul Eggert
2019-06-14 19:47   ` Tim Rühsen
2019-06-14 21:28     ` Bruno Haible
2019-06-14 21:47       ` Eric Blake
2019-06-14 23:17         ` Bruno Haible
2019-06-14 23:51           ` Bruno Haible
2019-06-15  0:47             ` Paul Eggert
2019-06-15  2:03               ` Bruno Haible
2019-06-15  7:23                 ` Paul Eggert
2019-06-15 11:06                   ` Bruno Haible
2019-06-15 11:25                     ` Darshit Shah [this message]
2019-06-15 12:01                       ` Emacs time stamp hook Bruno Haible
2019-06-15 13:39                         ` Darshit Shah
2019-06-15 15:25                           ` Bruno Haible
2019-06-15 18:35                             ` Paul Eggert
2019-06-15 19:48                               ` Bruno Haible
2019-06-16  0:30                                 ` Jim Meyering
2019-06-16 12:57                           ` Bruno Haible
2019-06-15 18:35                     ` Alpine: useless-if-before-free: Exec format error Paul Eggert
2019-06-15 20:14                       ` Bruno Haible
2019-06-15 23:17                         ` Paul Eggert
2019-06-16 13:12                           ` Bruno Haible
2019-06-18  0:51                             ` Paul Eggert
2019-06-18  1:32                               ` Bruno Haible
2019-06-18  2:30                                 ` Paul Eggert
2019-06-19 10:10                                   ` Bruno Haible
2019-06-23 16:32                                     ` Jim Meyering
2019-06-24  8:06                                       ` Tim Rühsen
2019-06-15 10:41             ` Bruno Haible

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=20190615112555.dlpl33puu4knwxzt@tardis.localdomain \
    --to=darnir@gnu.org \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=eblake@redhat.com \
    --cc=eggert@cs.ucla.edu \
    --cc=tim.ruehsen@gmx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).