Skip to contentSkip to conversation

use /usr/bin/env bash shebang instead of /bin/bash

PATCH Superseded Florian Klink 4 participants 21 messages Nov 27, 2019 – Dec 6, 2019 Documentation

lore
Share & tools
lore
#1 lore raw

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
index 6c08d7493..237ce26d8 100755
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/usr/bin/env bash -e
 
 IFILE=$1
 OFILE=$2
scripts/check_size +1 -1
index 8530435d3..76608eccc 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
scripts/dfuboot.sh +1 -1
index 524113b61..9847579ce 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 DEVICETREE=
 KERNEL=
scripts/extract_symbol_offset +1 -1
index 78b866830..d0ea22434 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
scripts/gen-dtb-s +1 -1
index b2dd253c2..0649247f9 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 name=$1
 dtb=$2
scripts/genenv +1 -1
index 5ebe69963..454f2327b 100755
@@ -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
index 36f67498b..5405bfa6b 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
scripts/socfpga_import_preloader +1 -1
index 6c748fadb..23e3c380d 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
scripts/socfpga_xml_to_config.sh +1 -1
index 7e22ebb9e..3bb0dd283 100755
@@ -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
#2 lore raw

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
index 6c08d7493..237ce26d8 100755

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 -0
 IFILE=$1
 OFILE=$2
scripts/check_size +1 -1
index 8530435d3..76608eccc 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
scripts/dfuboot.sh +1 -1
index 524113b61..9847579ce 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 DEVICETREE=
 KERNEL=
scripts/extract_symbol_offset +1 -1
index 78b866830..d0ea22434 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
scripts/gen-dtb-s +1 -1
index b2dd253c2..0649247f9 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 name=$1
 dtb=$2
scripts/genenv +1 -1
index 5ebe69963..454f2327b 100755
@@ -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
index 36f67498b..5405bfa6b 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
scripts/socfpga_import_preloader +1 -1
index 6c748fadb..23e3c380d 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
scripts/socfpga_xml_to_config.sh +1 -1
index 7e22ebb9e..3bb0dd283 100755
@@ -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
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
#3 lore raw

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 -0
index 6c08d7493..237ce26d8 100755

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:

Quoted 5 lines

/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.

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
#4 lore raw

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 -0
index 6c08d7493..237ce26d8 100755

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

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
#5 lore raw

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
index 6c08d7493..17fd47373 100755
@@ -1,4 +1,6 @@
-#!/bin/bash -e
+#!/usr/bin/env bash
+
+set -e
 
 IFILE=$1
 OFILE=$2
scripts/check_size +1 -1
index 8530435d3..76608eccc 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
scripts/dfuboot.sh +1 -1
index 524113b61..9847579ce 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 DEVICETREE=
 KERNEL=
scripts/extract_symbol_offset +1 -1
index 78b866830..d0ea22434 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
scripts/gen-dtb-s +1 -1
index b2dd253c2..0649247f9 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 name=$1
 dtb=$2
scripts/genenv +1 -1
index 5ebe69963..454f2327b 100755
@@ -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
index 36f67498b..5405bfa6b 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
scripts/socfpga_import_preloader +1 -1
index 6c748fadb..23e3c380d 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
scripts/socfpga_xml_to_config.sh +1 -1
index 7e22ebb9e..3bb0dd283 100755
@@ -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
#6 lore raw

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
index ccdbc0607..b7511e425 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 
dts/scripts/index-filter.sh +1 -1
index 961085502..c301fcea1 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 set -o pipefail
dts/scripts/merge-new-release.sh +1 -1
index a2763c69b..554b97b8e 100755
@@ -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
#7 lore raw

PATCH v2 3/4 docs: use #!/usr/bin/env bash shebang instead of #!/bin/bash

In reply to 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.

---
 Documentation/user/usb.rst | 2 +-
 MAKEALL                    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/user/usb.rst +1 -1
index 029e46354..4c1b2925f 100644
@@ -172,7 +172,7 @@ and initrd:
 
 .. code-block:: sh
 
-  #!/bin/bash
+  #!/usr/bin/env bash
 
   set -e
   set -v
MAKEALL +1 -1
index 909e170b1..3548739e3 100755
@@ -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
#8 lore raw

PATCH v2 4/4 docs: use #!/usr/bin/env python shebang instead of #!/usr/bin/python

In reply to Florian Klink

Some 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
index 203a39bb1..a55b1acd8 100755
@@ -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
#9 lore raw

Re: [PATCH v2 1/4] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash

In reply to Florian Klink
Quoted 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
index 6c08d7493..17fd47373 100755
@@ -1,4 +1,6 @@
-#!/bin/bash -e
+#!/usr/bin/env bash
+
+set -e
 
 IFILE=$1
 OFILE=$2
scripts/check_size +1 -1
index 8530435d3..76608eccc 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
scripts/dfuboot.sh +1 -1
index 524113b61..9847579ce 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 DEVICETREE=
 KERNEL=
scripts/extract_symbol_offset +1 -1
index 78b866830..d0ea22434 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
scripts/gen-dtb-s +1 -1
index b2dd253c2..0649247f9 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 name=$1
 dtb=$2
scripts/genenv +1 -1
index 5ebe69963..454f2327b 100755
@@ -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
index 36f67498b..5405bfa6b 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
scripts/socfpga_import_preloader +1 -1
index 6c748fadb..23e3c380d 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
scripts/socfpga_xml_to_config.sh +1 -1
index 7e22ebb9e..3bb0dd283 100755
@@ -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
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
#11 lore raw

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
index 6c08d7493..17fd47373 100755
@@ -1,4 +1,6 @@
-#!/bin/bash -e
+#!/usr/bin/env bash
+
+set -e
 
 IFILE=$1
 OFILE=$2
scripts/check_size +1 -1
index 8530435d3..76608eccc 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
scripts/dfuboot.sh +1 -1
index 524113b61..9847579ce 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 DEVICETREE=
 KERNEL=
scripts/extract_symbol_offset +1 -1
index 78b866830..d0ea22434 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
scripts/gen-dtb-s +1 -1
index b2dd253c2..0649247f9 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 name=$1
 dtb=$2
scripts/genenv +1 -1
index 5ebe69963..454f2327b 100755
@@ -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
index 36f67498b..5405bfa6b 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
scripts/socfpga_import_preloader +1 -1
index 6c748fadb..23e3c380d 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
scripts/socfpga_xml_to_config.sh +1 -1
index 7e22ebb9e..3bb0dd283 100755
@@ -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
#12 lore raw

PATCH v3 2/4 dts/scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash

In reply to 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.

---
 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
index ccdbc0607..b7511e425 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 
dts/scripts/index-filter.sh +1 -1
index 961085502..c301fcea1 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 set -o pipefail
dts/scripts/merge-new-release.sh +1 -1
index a2763c69b..554b97b8e 100755
@@ -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
#13 lore raw

PATCH v3 3/4 docs: use #!/usr/bin/env bash shebang instead of #!/bin/bash

In reply to 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.

---
 Documentation/user/usb.rst | 2 +-
 MAKEALL                    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/user/usb.rst +1 -1
index 029e46354..4c1b2925f 100644
@@ -172,7 +172,7 @@ and initrd:
 
 .. code-block:: sh
 
-  #!/bin/bash
+  #!/usr/bin/env bash
 
   set -e
   set -v
MAKEALL +1 -1
index 909e170b1..3548739e3 100755
@@ -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
#14 lore raw

PATCH v3 4/4 docs: use #!/usr/bin/env python shebang instead of #!/usr/bin/python

In reply to Florian Klink

Some 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
index 203a39bb1..a55b1acd8 100755
@@ -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
Applied
#15 lore raw

Re: use #!/usr/bin/env binary instead of #!/usr/bin/binary

In reply to Florian Klink
Quoted 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
#16 lore raw

Re: [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash

In reply to Michael Olbrich
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 -0
index 6c08d7493..237ce26d8 100755

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:

Quoted 5 lines

/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.

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
#17 lore raw

PATCH 2/3 dts/scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash

In reply to 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.

---
 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
index ccdbc0607..b7511e425 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 
dts/scripts/index-filter.sh +1 -1
index 961085502..c301fcea1 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 set -o pipefail
dts/scripts/merge-new-release.sh +1 -1
index a2763c69b..554b97b8e 100755
@@ -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
#18 lore raw

PATCH 3/3 docs: use #!/usr/bin/env bash shebang instead of #!/bin/bash

In reply to 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.

---
 Documentation/user/usb.rst | 2 +-
 MAKEALL                    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/user/usb.rst +1 -1
index 029e46354..4c1b2925f 100644
@@ -172,7 +172,7 @@ and initrd:
 
 .. code-block:: sh
 
-  #!/bin/bash
+  #!/usr/bin/env bash
 
   set -e
   set -v
MAKEALL +1 -1
index 909e170b1..3548739e3 100755
@@ -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
#19 lore raw
In reply to Florian Klink

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
#20 lore raw
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