use /usr/bin/env bash shebang instead of /bin/bash
Some distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/3 scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
Some distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
--- scripts/canon-a1100-image | 2 +- scripts/check_size | 2 +- scripts/dfuboot.sh | 2 +- scripts/extract_symbol_offset | 2 +- scripts/gen-dtb-s | 2 +- scripts/genenv | 2 +- scripts/socfpga_get_sequencer | 2 +- scripts/socfpga_import_preloader | 2 +- scripts/socfpga_xml_to_config.sh | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-)
scripts/canon-a1100-image +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash -e IFILE=$1 OFILE=$2
scripts/check_size +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash symbol="$1" file="$2"
scripts/dfuboot.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash DEVICETREE= KERNEL=
scripts/extract_symbol_offset +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash symbol="$1" file="$2"
scripts/gen-dtb-s +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash name=$1 dtb=$2
scripts/genenv +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Generate the default environment file from a list of directories # usage: genenv <basedir> <objdir> <target> <dir>...
scripts/socfpga_get_sequencer +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ "$#" -lt "2" ] then
scripts/socfpga_import_preloader +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ "$#" -lt "2" ] then
scripts/socfpga_xml_to_config.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ## TODO: ## - read in mpuclk and nocclk, must be calculated by hand at the moment
Signature · 7 lines
2.24.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
Quoted 21 lines · Florian Klink
Some distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
--- scripts/canon-a1100-image | 2 +- scripts/check_size | 2 +- scripts/dfuboot.sh | 2 +- scripts/extract_symbol_offset | 2 +- scripts/gen-dtb-s | 2 +- scripts/genenv | 2 +- scripts/socfpga_get_sequencer | 2 +- scripts/socfpga_import_preloader | 2 +- scripts/socfpga_xml_to_config.sh | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-)scripts/canon-a1100-image +0
-0
scripts/canon-a1100-image line 1
Quoted 2 lines
scripts/canon-a1100-image +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash -e
This does not work:
/usr/bin/env: ‘bash -e’: No such file or directory /usr/bin/env: use -[v]S to pass options in shebang lines
Using '/usr/bin/env -S bash -e' works, but I'm not sure how portable that is.
Michael
Quoted 92 lines
scripts/canon-a1100-image +0
-0IFILE=$1 OFILE=$2scripts/check_size +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash symbol="$1" file="$2"scripts/dfuboot.sh +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash DEVICETREE= KERNEL=scripts/extract_symbol_offset +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash symbol="$1" file="$2"scripts/gen-dtb-s +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash name=$1 dtb=$2scripts/genenv +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Generate the default environment file from a list of directories # usage: genenv <basedir> <objdir> <target> <dir>...scripts/socfpga_get_sequencer +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ "$#" -lt "2" ] thenscripts/socfpga_import_preloader +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ "$#" -lt "2" ] thenscripts/socfpga_xml_to_config.sh +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ## TODO: ## - read in mpuclk and nocclk, must be calculated by hand at the momentSignature · 7 lines
2.24.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
Quoted 27 lines · Michael Olbrich
Quoted 21 lines · Florian Klink
Some distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
--- scripts/canon-a1100-image | 2 +- scripts/check_size | 2 +- scripts/dfuboot.sh | 2 +- scripts/extract_symbol_offset | 2 +- scripts/gen-dtb-s | 2 +- scripts/genenv | 2 +- scripts/socfpga_get_sequencer | 2 +- scripts/socfpga_import_preloader | 2 +- scripts/socfpga_xml_to_config.sh | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-)scripts/canon-a1100-image +0
-0scripts/canon-a1100-image line 1
Quoted 2 lines
scripts/canon-a1100-image +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash -eThis does not work:
Quoted 5 lines
/usr/bin/env: ‘bash -e’: No such file or directory/usr/bin/env: use -[v]S to pass options in shebang linesUsing '
/usr/bin/env-S bash -e' works, but I'm not sure how portable that is.
Why not:
#!/usr/bin/env bash
set -e
?
Sascha
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
Quoted 31 lines · Sascha Hauer
Quoted 30 lines · Michael Olbrich
Quoted 21 lines · Florian Klink
Some distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
--- scripts/canon-a1100-image | 2 +- scripts/check_size | 2 +- scripts/dfuboot.sh | 2 +- scripts/extract_symbol_offset | 2 +- scripts/gen-dtb-s | 2 +- scripts/genenv | 2 +- scripts/socfpga_get_sequencer | 2 +- scripts/socfpga_import_preloader | 2 +- scripts/socfpga_xml_to_config.sh | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-)scripts/canon-a1100-image +0
-0scripts/canon-a1100-image line 1
Quoted 2 lines
scripts/canon-a1100-image +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash -eThis does not work:
/usr/bin/env: ‘bash -e’: No such file or directory/usr/bin/env: use -[v]S to pass options in shebang lines
Quoted 8 lines
Quoted 2 lines
Using '
/usr/bin/env-S bash -e' works, but I'm not sure how portable that is.Why not:
#!/usr/bin/env bash
set -e
Yes, that should work.
Michael
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 1/4 scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
Some distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
--- scripts/canon-a1100-image | 4 +++- scripts/check_size | 2 +- scripts/dfuboot.sh | 2 +- scripts/extract_symbol_offset | 2 +- scripts/gen-dtb-s | 2 +- scripts/genenv | 2 +- scripts/socfpga_get_sequencer | 2 +- scripts/socfpga_import_preloader | 2 +- scripts/socfpga_xml_to_config.sh | 2 +- 9 files changed, 11 insertions(+), 9 deletions(-)
scripts/canon-a1100-image +3 -1
@@ -1,4 +1,6 @@ -#!/bin/bash -e +#!/usr/bin/env bash + +set -e IFILE=$1 OFILE=$2
scripts/check_size +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash symbol="$1" file="$2"
scripts/dfuboot.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash DEVICETREE= KERNEL=
scripts/extract_symbol_offset +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash symbol="$1" file="$2"
scripts/gen-dtb-s +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash name=$1 dtb=$2
scripts/genenv +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Generate the default environment file from a list of directories # usage: genenv <basedir> <objdir> <target> <dir>...
scripts/socfpga_get_sequencer +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ "$#" -lt "2" ] then
scripts/socfpga_import_preloader +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ "$#" -lt "2" ] then
scripts/socfpga_xml_to_config.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ## TODO: ## - read in mpuclk and nocclk, must be calculated by hand at the moment
Signature · 7 lines
2.24.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 2/4 dts/scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
Some distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
--- dts/scripts/cronjob | 2 +- dts/scripts/index-filter.sh | 2 +- dts/scripts/merge-new-release.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
dts/scripts/cronjob +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e
dts/scripts/index-filter.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e set -o pipefail
dts/scripts/merge-new-release.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash case $1 in v*-dts) ;;
Signature · 7 lines
2.24.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 3/4 docs: use #!/usr/bin/env bash shebang instead of #!/bin/bash
In reply to Florian KlinkSome distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
--- Documentation/user/usb.rst | 2 +- MAKEALL | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/user/usb.rst +1 -1
@@ -172,7 +172,7 @@ and initrd: .. code-block:: sh - #!/bin/bash + #!/usr/bin/env bash set -e set -v
MAKEALL +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Print statistics when we exit trap exit 1 2 3 15
Signature · 7 lines
2.24.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 4/4 docs: use #!/usr/bin/env python shebang instead of #!/usr/bin/python
In reply to Florian KlinkSome distributions might not have python in /usr/bin, but in $PATH.
Using #!/usr/bin/env python solves this, and is consistent with how the other perl and python shebangs look like in the tree.
--- Documentation/gen_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/gen_commands.py +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python from __future__ import print_function
Signature · 7 lines
2.24.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH v2 1/4] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
In reply to Florian KlinkQuoted 4 lines · Florian Klink
Some distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
Your Signed-off-by tag is missing on all patches. Please add it to certify that your changes are distributable under the respective project license (i.e. GPL-2.0-only). See <https://developercertificate.org/> and ./COPYING in the barebox tree for more info.
- Roland
Quoted 113 lines
--- scripts/canon-a1100-image | 4 +++- scripts/check_size | 2 +- scripts/dfuboot.sh | 2 +- scripts/extract_symbol_offset | 2 +- scripts/gen-dtb-s | 2 +- scripts/genenv | 2 +- scripts/socfpga_get_sequencer | 2 +- scripts/socfpga_import_preloader | 2 +- scripts/socfpga_xml_to_config.sh | 2 +- 9 files changed, 11 insertions(+), 9 deletions(-)scripts/canon-a1100-image +3
-1@@ -1,4 +1,6 @@ -#!/bin/bash -e +#!/usr/bin/env bash + +set -e IFILE=$1 OFILE=$2scripts/check_size +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash symbol="$1" file="$2"scripts/dfuboot.sh +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash DEVICETREE= KERNEL=scripts/extract_symbol_offset +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash symbol="$1" file="$2"scripts/gen-dtb-s +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash name=$1 dtb=$2scripts/genenv +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Generate the default environment file from a list of directories # usage: genenv <basedir> <objdir> <target> <dir>...scripts/socfpga_get_sequencer +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ "$#" -lt "2" ] thenscripts/socfpga_import_preloader +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ "$#" -lt "2" ] thenscripts/socfpga_xml_to_config.sh +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ## TODO: ## - read in mpuclk and nocclk, must be calculated by hand at the momentSignature · 7 lines
2.24.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Roland Hieber, Pengutronix e.K. | [email protected] | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
use #!/usr/bin/env binary instead of #!/usr/bin/binary
This adds the missing Signed-off-by Tag to all patches. Sorry for the noise.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 1/4 scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
Some distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
--- scripts/canon-a1100-image | 4 +++- scripts/check_size | 2 +- scripts/dfuboot.sh | 2 +- scripts/extract_symbol_offset | 2 +- scripts/gen-dtb-s | 2 +- scripts/genenv | 2 +- scripts/socfpga_get_sequencer | 2 +- scripts/socfpga_import_preloader | 2 +- scripts/socfpga_xml_to_config.sh | 2 +- 9 files changed, 11 insertions(+), 9 deletions(-)
scripts/canon-a1100-image +3 -1
@@ -1,4 +1,6 @@ -#!/bin/bash -e +#!/usr/bin/env bash + +set -e IFILE=$1 OFILE=$2
scripts/check_size +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash symbol="$1" file="$2"
scripts/dfuboot.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash DEVICETREE= KERNEL=
scripts/extract_symbol_offset +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash symbol="$1" file="$2"
scripts/gen-dtb-s +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash name=$1 dtb=$2
scripts/genenv +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Generate the default environment file from a list of directories # usage: genenv <basedir> <objdir> <target> <dir>...
scripts/socfpga_get_sequencer +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ "$#" -lt "2" ] then
scripts/socfpga_import_preloader +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ "$#" -lt "2" ] then
scripts/socfpga_xml_to_config.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ## TODO: ## - read in mpuclk and nocclk, must be calculated by hand at the moment
Signature · 7 lines
2.24.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 2/4 dts/scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
In reply to Florian KlinkSome distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
--- dts/scripts/cronjob | 2 +- dts/scripts/index-filter.sh | 2 +- dts/scripts/merge-new-release.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
dts/scripts/cronjob +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e
dts/scripts/index-filter.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e set -o pipefail
dts/scripts/merge-new-release.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash case $1 in v*-dts) ;;
Signature · 7 lines
2.24.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 3/4 docs: use #!/usr/bin/env bash shebang instead of #!/bin/bash
In reply to Florian KlinkSome distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
--- Documentation/user/usb.rst | 2 +- MAKEALL | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/user/usb.rst +1 -1
@@ -172,7 +172,7 @@ and initrd: .. code-block:: sh - #!/bin/bash + #!/usr/bin/env bash set -e set -v
MAKEALL +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Print statistics when we exit trap exit 1 2 3 15
Signature · 7 lines
2.24.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v3 4/4 docs: use #!/usr/bin/env python shebang instead of #!/usr/bin/python
In reply to Florian KlinkSome distributions might not have python in /usr/bin, but in $PATH.
Using #!/usr/bin/env python solves this, and is consistent with how the other perl and python shebangs look like in the tree.
--- Documentation/gen_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/gen_commands.py +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python from __future__ import print_function
Signature · 7 lines
2.24.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedRe: use #!/usr/bin/env binary instead of #!/usr/bin/binary
In reply to Florian KlinkQuoted 3 lines · Florian Klink
This adds the missing Signed-off-by Tag to all patches. Sorry for the noise.
Applied, thanks
Sascha
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
In reply to Michael OlbrichQuoted 27 lines · Michael Olbrich
Quoted 21 lines · Florian Klink
Some distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
--- scripts/canon-a1100-image | 2 +- scripts/check_size | 2 +- scripts/dfuboot.sh | 2 +- scripts/extract_symbol_offset | 2 +- scripts/gen-dtb-s | 2 +- scripts/genenv | 2 +- scripts/socfpga_get_sequencer | 2 +- scripts/socfpga_import_preloader | 2 +- scripts/socfpga_xml_to_config.sh | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-)scripts/canon-a1100-image +0
-0scripts/canon-a1100-image line 1
Quoted 2 lines
scripts/canon-a1100-image +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/usr/bin/env bash -eThis does not work:
Quoted 5 lines
/usr/bin/env: ‘bash -e’: No such file or directory/usr/bin/env: use -[v]S to pass options in shebang linesUsing '
/usr/bin/env-S bash -e' works, but I'm not sure how portable that is.
According to execve(2) [1], this behaviour is specific to Linux:
The semantics of the optional-arg argument of an interpreter script vary across implementations. On Linux, the entire string following the interpreter name is passed as a single argument to the interpreter, and this string can include white space. However, behavior differs on some other systems. Some systems use the first white space to terminate optional-arg. On some systems, an interpreter script can have multiple arguments, and white spaces in optional-arg are used to delimit the arguments.
So /usr/bin/env apparently does some argument splitting itself when called with -S.
[1]: http://man7.org/linux/man-pages/man2/execve.2.html#NOTES
- Roland
Signature · 9 lines
Roland Hieber, Pengutronix e.K. | [email protected] | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/3 dts/scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
In reply to Florian KlinkSome distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
--- dts/scripts/cronjob | 2 +- dts/scripts/index-filter.sh | 2 +- dts/scripts/merge-new-release.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
dts/scripts/cronjob +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e
dts/scripts/index-filter.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e set -o pipefail
dts/scripts/merge-new-release.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash case $1 in v*-dts) ;;
Signature · 7 lines
2.24.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 3/3 docs: use #!/usr/bin/env bash shebang instead of #!/bin/bash
In reply to Florian KlinkSome distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
--- Documentation/user/usb.rst | 2 +- MAKEALL | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/user/usb.rst +1 -1
@@ -172,7 +172,7 @@ and initrd: .. code-block:: sh - #!/bin/bash + #!/usr/bin/env bash set -e set -v
MAKEALL +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Print statistics when we exit trap exit 1 2 3 15
Signature · 7 lines
2.24.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Hi FLorian,
Quoted 5 lines · Florian Klink
Some distributions might not have bash in /bin, but in $PATH.
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
What is the exact case you are fixing with these patches? I am fine with merging them generally, I just want to understand why and where you need it.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 6 lines
Quoted 2 lines
Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree.
What is the exact case you are fixing with these patches? I am fine with merging them generally, I just want to understand why and where you need it.
In that particular case, it improves interactively building on NixOS (which doesn't have /bin/bash).
We can patch shebangs during a package build, but having shebangs working out of the box after cloning a git checkout really helps while tinkering.
Also, it just feels right, given we do the same with /usr/bin/env perl and /usr/bin/env python there aswell.
Florian
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox