diff options
author | Bruno Haible <bruno@clisp.org> | 2019-06-15 13:03:58 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2019-06-15 13:06:55 +0200 |
commit | a05d5d121b10f24fc33e1820db436507bd6c58f0 (patch) | |
tree | fceb04767b2a25379bf6d5ca2c5fc4fa996ad68a /build-aux | |
parent | 5905d8ca9945f0d60ff40eb6cfa42afc0199ab8f (diff) | |
download | gnulib-a05d5d121b10f24fc33e1820db436507bd6c58f0.tar.gz |
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.
Diffstat (limited to 'build-aux')
-rwxr-xr-x | build-aux/announce-gen | 20 | ||||
-rwxr-xr-x | build-aux/gitlog-to-changelog | 20 | ||||
-rwxr-xr-x | build-aux/prefix-gnulib-mk | 19 | ||||
-rwxr-xr-x | build-aux/update-copyright | 20 | ||||
-rwxr-xr-x | build-aux/useless-if-before-free | 20 |
5 files changed, 84 insertions, 15 deletions
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 diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog index deddef2446..a616b82343 100755 --- a/build-aux/gitlog-to-changelog +++ b/build-aux/gitlog-to-changelog @@ -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; + # Convert git log output to ChangeLog format. my $VERSION = '2018-03-07 03:47'; # UTC diff --git a/build-aux/prefix-gnulib-mk b/build-aux/prefix-gnulib-mk index bef726f6bb..66e138b46f 100755 --- a/build-aux/prefix-gnulib-mk +++ b/build-aux/prefix-gnulib-mk @@ -1,6 +1,19 @@ -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; use strict; use IO::File; diff --git a/build-aux/update-copyright b/build-aux/update-copyright index d80549ea8d..fa9d427e92 100755 --- a/build-aux/update-copyright +++ b/build-aux/update-copyright @@ -1,6 +1,20 @@ -eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"' - & eval 'exec perl -wS -0777 -pi "$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; + # Update an FSF copyright year list to include the current year. my $VERSION = '2018-03-07.03:47'; # UTC diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free index 6d6b8d4199..0701e7b20b 100755 --- a/build-aux/useless-if-before-free +++ b/build-aux/useless-if-before-free @@ -1,6 +1,20 @@ -eval '(exit $?0)' && eval 'exec perl -wST "$0" "$@"' - & eval 'exec perl -wST "$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; + # Detect instances of "if (p) free (p);". # Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces. |