Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 additions & 11 deletions classes/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,23 +163,34 @@ packageSetup: |
fi
}

# replace absolute interpreter paths with /usr/bin/env <interpreter>
# Replace absolute interpreter paths with "/usr/bin/env <interpreter>" for
# all executable scripts in directory.
#
# $1: directory (optional, defaults to ".")
installFixShebang()
{
local f old new
local shebang
while IFS= read -r -d $'\0' f; do
if cmp -s -n2 "$f" <<<'#!' ; then
read -r old_cmd old_arg < "$f"
if [[ "$old_cmd" == "#!/usr/bin/env" ]]; then
continue
read -n 4096 -r shebang < "$f"
if [[ "${shebang:0:2}" == "#!" ]] ; then
# Match part after "#!". Tabs and spaces before and after the
# command are stripped by the kernel. We need to do the same!
if [[ "${shebang:2}" =~ ^[$' \t']*([$'^ \t']+)[$' \t']*(.*)$ ]] ; then
case "${BASH_REMATCH[1]}" in
/usr/bin/env | /bin/sh | /bin/bash)
continue
;;
esac

local cmd="${BASH_REMATCH[1]##*/}"
local arg="${BASH_REMATCH[2]}"
new="#!/usr/bin/env ${arg:+-S }${cmd}${arg:+ ${arg@Q}}"
sed -i -e "1c $new" "$f"
else
old_cmd="${old_cmd:2}"
old_cmd="${old_cmd##*/}"
echo "WARNING: unrecognized shebang: $shebang"
fi
new="#!/usr/bin/env ${old_arg:+-S }${old_cmd}${old_arg:+ ${old_arg@Q}}"
sed -i -e "1c $new" "$f"
fi
done < <(find "${1:-.}" -type f -perm -/111 -print0)
done < <(find "${1:-.}" -type f -perm /111 -print0)
}

# Everything except shared or static libraries or header files.
Expand Down
2 changes: 1 addition & 1 deletion recipes/devel/autoconf-2.69.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ checkoutSCM:

checkoutDeterministic: True
checkoutScript: |
patchApplySeries $<<autoconf-2.69/*.patch>>
patchApplySeries $<@autoconf-2.69/*.patch@>
# We patch some files that would trigger the rebuild of the manpages.
# Prevent that...
touch man/*.1
Expand Down
86 changes: 86 additions & 0 deletions recipes/devel/autoconf-2.69/0003-remove-abs-perl-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
From: Jan Kloetzke <jan@kloetzke.net>
Subject: [PATCH] Remove absolute perl path

The variaous autoconf scipts contain the trick that let's them execute
even if they are interpreted by the shell. This line has the full path
to perl which will not be correct in Bobs environment. As it is
unneeded in the first place, just remove it.

diff -Nurp a/bin/autoheader.in b/bin/autoheader.in
--- a/bin/autoheader.in 2025-09-12 15:51:09.408126785 +0200
+++ b/bin/autoheader.in 2025-09-12 15:53:30.661992545 +0200
@@ -2,9 +2,6 @@
# -*- Perl -*-
# @configure_input@

-eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
- if 0;
-
# autoheader -- create `config.h.in' from `configure.ac'

# Copyright (C) 1992-1994, 1996, 1998-2012 Free Software Foundation,
diff -Nurp a/bin/autom4te.in b/bin/autom4te.in
--- a/bin/autom4te.in 2025-09-12 15:51:09.408126785 +0200
+++ b/bin/autom4te.in 2025-09-12 15:53:30.753996376 +0200
@@ -2,9 +2,6 @@
# -*- perl -*-
# @configure_input@

-eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
- if 0;
-
# autom4te - Wrapper around M4 libraries.
# Copyright (C) 2001-2003, 2005-2012 Free Software Foundation, Inc.

diff -Nurp a/bin/autoreconf.in b/bin/autoreconf.in
--- a/bin/autoreconf.in 2025-09-12 15:51:09.408126785 +0200
+++ b/bin/autoreconf.in 2025-09-12 15:53:30.850000372 +0200
@@ -2,9 +2,6 @@
# -*- perl -*-
# @configure_input@

-eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
- if 0;
-
# autoreconf - install the GNU Build System in a directory tree
# Copyright (C) 1994, 1999-2012 Free Software Foundation, Inc.

diff -Nurp a/bin/autoscan.in b/bin/autoscan.in
--- a/bin/autoscan.in 2025-09-12 15:51:09.408126785 +0200
+++ b/bin/autoscan.in 2025-09-12 15:53:30.934003871 +0200
@@ -20,9 +20,6 @@

# Written by David MacKenzie <djm@gnu.ai.mit.edu>.

-eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
- if 0;
-
BEGIN
{
use File::Basename;
diff -Nurp a/bin/autoupdate.in b/bin/autoupdate.in
--- a/bin/autoupdate.in 2025-09-12 15:51:09.408126785 +0200
+++ b/bin/autoupdate.in 2025-09-12 15:53:31.026007701 +0200
@@ -21,9 +21,6 @@
# Originally written by David MacKenzie <djm@gnu.ai.mit.edu>.
# Rewritten by Akim Demaille <akim@freefriends.org>.

-eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
- if 0;
-
BEGIN
{
use File::Basename;
diff -Nurp a/bin/ifnames.in b/bin/ifnames.in
--- a/bin/ifnames.in 2025-09-12 15:51:09.408126785 +0200
+++ b/bin/ifnames.in 2025-09-12 15:53:31.074009699 +0200
@@ -2,9 +2,6 @@
# -*- perl -*-
# @configure_input@

-eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
- if 0;
-
# ifnames - print the identifiers used in C preprocessor conditionals

# Copyright (C) 1994-1995, 1999-2003, 2005-2012 Free Software
99 changes: 99 additions & 0 deletions recipes/devel/autoconf/0003-remove-abs-perl-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
From: Jan Kloetzke <jan@kloetzke.net>
Subject: [PATCH] Remove absolute perl path

The variaous autoconf scipts contain the trick that let's them execute
even if they are interpreted by the shell. This line has the full path
to perl which will not be correct in Bobs environment. As it is
unneeded in the first place, just remove it.

diff -Nurp a/bin/autoconf.in b/bin/autoconf.in
--- a/bin/autoconf.in 2025-09-12 11:22:28.208013268 +0200
+++ b/bin/autoconf.in 2025-09-12 15:37:32.333735416 +0200
@@ -2,9 +2,6 @@
# -*- Perl -*-
# @configure_input@

-eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
- if 0;
-
# autoconf -- create 'configure' using m4 macros.

# Copyright (C) 1992-1994, 1996, 1999-2017, 2020-2023 Free Software
diff -Nurp a/bin/autoheader.in b/bin/autoheader.in
--- a/bin/autoheader.in 2025-09-12 11:22:28.208013268 +0200
+++ b/bin/autoheader.in 2025-09-12 15:37:35.989891503 +0200
@@ -2,9 +2,6 @@
# -*- Perl -*-
# @configure_input@

-eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
- if 0;
-
# autoheader -- create 'config.h.in' from 'configure.ac'.

# Copyright (C) 1992-1994, 1996, 1998-2017, 2020-2023 Free Software
diff -Nurp a/bin/autom4te.in b/bin/autom4te.in
--- a/bin/autom4te.in 2025-09-12 11:22:28.212013444 +0200
+++ b/bin/autom4te.in 2025-09-12 15:37:39.382036313 +0200
@@ -2,9 +2,6 @@
# -*- perl -*-
# @configure_input@

-eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
- if 0;
-
# autom4te - Wrapper around M4 libraries.
# Copyright (C) 2001-2003, 2005-2017, 2020-2023 Free Software
# Foundation, Inc.
diff -Nurp a/bin/autoreconf.in b/bin/autoreconf.in
--- a/bin/autoreconf.in 2025-09-12 11:22:28.212013444 +0200
+++ b/bin/autoreconf.in 2025-09-12 15:37:44.074236624 +0200
@@ -2,9 +2,6 @@
# -*- perl -*-
# @configure_input@

-eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
- if 0;
-
# autoreconf - install the GNU Build System in a directory tree
# Copyright (C) 1994, 1999-2017, 2020-2023 Free Software Foundation,
# Inc.
diff -Nurp a/bin/autoscan.in b/bin/autoscan.in
--- a/bin/autoscan.in 2025-09-12 11:22:28.212013444 +0200
+++ b/bin/autoscan.in 2025-09-12 15:38:05.559153749 +0200
@@ -21,9 +21,6 @@

# Written by David MacKenzie <djm@gnu.ai.mit.edu>.

-eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
- if 0;
-
use 5.006;
use strict;
use warnings FATAL => 'all';
diff -Nurp a/bin/autoupdate.in b/bin/autoupdate.in
--- a/bin/autoupdate.in 2025-09-12 11:22:28.212013444 +0200
+++ b/bin/autoupdate.in 2025-09-12 15:38:05.683159042 +0200
@@ -22,9 +22,6 @@
# Originally written by David MacKenzie <djm@gnu.ai.mit.edu>.
# Rewritten by Akim Demaille <akim@freefriends.org>.

-eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
- if 0;
-
use 5.006;
use strict;
use warnings FATAL => 'all';
diff -Nurp a/bin/ifnames.in b/bin/ifnames.in
--- a/bin/ifnames.in 2025-09-12 11:22:28.212013444 +0200
+++ b/bin/ifnames.in 2025-09-12 15:38:05.735161261 +0200
@@ -2,9 +2,6 @@
# -*- perl -*-
# @configure_input@

-eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
- if 0;
-
# ifnames - print the identifiers used in C preprocessor conditionals

# Copyright (C) 1994-1995, 1999-2003, 2005-2017, 2020-2023 Free Software