build: doc: refer to bash as bash, not /bin/bash
PATCH 1/1 build: doc: refer to bash as bash, not /bin/bash
This locates bash according to its presence in the PATH, not at a hard-coded path which may not exist or may not be the most suitable bash to use.
--- doxygen/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
doxygen/Makefile.am +1 -1
@@ -21,7 +21,7 @@ doxyfile.stamp: $(doc_srcs) Makefile.am # The command has to be a single line so the functions work # and so `make` gives all lines to `bash -c` # (hence ";\" at the end of every line but the last). - /bin/bash -p -c 'declare -A renamed_page;\ + bash -p -c 'declare -A renamed_page;\ main(){ set -e; cd man/man3; rm -f _*;\ count_real_pages;\ rename_real_pages;\
Signature · 1 line
2.37.1
Hi Mark,
Quoted 23 lines · Mark Mentovai
This locates bash according to its presence in the PATH, not at a hard-coded path which may not exist or may not be the most suitable bash to use.
Signed-off-by Mark Mentovai <[email protected]>--- doxygen/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)doxygen/Makefile.am +1
-2@@ -21,7 +21,7 @@ doxyfile.stamp: $(doc_srcs) Makefile.am # The command has to be a single line so the functions work # and so `make` gives all lines to `bash -c` # (hence ";\" at the end of every line but the last). - /bin/bash -p -c 'declare -A renamed_page;\ + bash -p -c 'declare -A renamed_page;\ main(){ set -e; cd man/man3; rm -f _*;\ count_real_pages;\ rename_real_pages;\ --
Quoted 2 lines
2.37.1
I would not apply this patch unless it's actually necessary for some distribution.
If you have discovered a distribution where /bin/bash doesn't work, please let us know.
Scripts that start "#!/bin/bash" are not uncommon, and Netfilter already has a couple of these, in libnetfilter_queue and libnetfilter_log.
I somehow omitted to update libmnl to replace the cumbersome embedded script in Makefile.am with a stand-alone script, but you've reminded me.
Cheers ... Duncan.
Quoted 32 lines · Duncan Roe
Quoted 23 lines · Mark Mentovai
This locates bash according to its presence in the PATH, not at a hard-coded path which may not exist or may not be the most suitable bash to use.
Signed-off-by Mark Mentovai <[email protected]>--- doxygen/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)doxygen/Makefile.am +1
-2@@ -21,7 +21,7 @@ doxyfile.stamp: $(doc_srcs) Makefile.am # The command has to be a single line so the functions work # and so `make` gives all lines to `bash -c` # (hence ";\" at the end of every line but the last). - /bin/bash -p -c 'declare -A renamed_page;\ + bash -p -c 'declare -A renamed_page;\ main(){ set -e; cd man/man3; rm -f _*;\ count_real_pages;\ rename_real_pages;\ --Quoted 2 lines
2.37.1
I would not apply this patch unless it's actually necessary for some distribution.
If you have discovered a distribution where
/bin/bashdoesn't work, please let us know.
Quoted 7 lines
Scripts that start "#!/bin/bash" are not uncommon, and Netfilter already has a couple of these, in
libnetfilter_queueandlibnetfilter_log.I somehow omitted to update libmnl to replace the cumbersome embedded script in Makefile.am with a stand-alone script, but you've reminded me.
Cheers ... Duncan.
The context here is in OpenWrt, https://github.com/openwrt/openwrt/commit/beeb49740bb4. The use of /bin/bash is a problem during a cross build of libmnl, with a build system running macOS or BSD. /bin/bash on macOS is an unsuitably old version, and the OpenWrt build ensures that a recent bash is available in PATH. BSD derivatives tend not to have /bin/bash at all, although bash may be present elsewhere in PATH. Again, the OpenWrt build ensures this.
I would not expect the same treatment to be strictly necessary for scripts like libnetfilter_queue or libnetfilter_log, which run on the target system, but the reliance on /bin/bash is a problem for cross builds and in particular non-Linux build systems. Considering that these cross builds are otherwise perfectly clean given an appropriate toolchain, it seems unnecessary to leave them broken for something like this, when a simple reliance on locating bash via PATH ought to suffice for everyone.
Mark
On Tue, Aug 02, 2022 at 02:14:29PM -0400, Mark Mentovai wrote:
[...]
Quoted 17 lines
The context here is in OpenWrt,
https://github.com/openwrt/openwrt/commit/beeb49740bb4. The use of/bin/bashis a problem during a cross build of libmnl, with a build system running macOS or BSD./bin/bashon macOS is an unsuitably old version, and the OpenWrt build ensures that a recent bash is available in PATH. BSD derivatives tend not to have/bin/bashat all, although bash may be present elsewhere in PATH. Again, the OpenWrt build ensures this.I would not expect the same treatment to be strictly necessary for scripts like
libnetfilter_queueorlibnetfilter_log, which run on the target system, but the reliance on/bin/bashis a problem for cross builds and in particular non-Linux build systems. Considering that these cross builds are otherwise perfectly clean given an appropriate toolchain, it seems unnecessary to leave them broken for something like this, when a simple reliance on locating bash via PATH ought to suffice for everyone.
Quoted 1 line
Mark
Good enough for me - I acked the original patch.
Cheers ... Duncan.
Quoted 23 lines · Mark Mentovai
This locates bash according to its presence in the PATH, not at a hard-coded path which may not exist or may not be the most suitable bash to use.
Signed-off-by Mark Mentovai <[email protected]>--- doxygen/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)doxygen/Makefile.am +1
-2@@ -21,7 +21,7 @@ doxyfile.stamp: $(doc_srcs) Makefile.am # The command has to be a single line so the functions work # and so `make` gives all lines to `bash -c` # (hence ";\" at the end of every line but the last). - /bin/bash -p -c 'declare -A renamed_page;\ + bash -p -c 'declare -A renamed_page;\ main(){ set -e; cd man/man3; rm -f _*;\ count_real_pages;\ rename_real_pages;\ --
Quoted 2 lines
2.37.1