From a05d5d121b10f24fc33e1820db436507bd6c58f0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 15 Jun 2019 13:03:58 +0200 Subject: Fix scripts to have valid executable format on Alpine Linux. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported by Tim Rühsen . 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. --- build-aux/announce-gen | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'build-aux/announce-gen') diff --git a/build-aux/announce-gen b/build-aux/announce-gen index 0174f5c8d1..b5728338c7 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 -- cgit v1.2.1