mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* use /usr/bin/env bash shebang instead of /bin/bash
@ 2019-11-27 23:19 Florian Klink
  2019-11-27 23:19 ` [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Florian Klink
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Florian Klink @ 2019-11-27 23:19 UTC (permalink / raw)
  To: barebox


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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
  2019-11-27 23:19 use /usr/bin/env bash shebang instead of /bin/bash Florian Klink
@ 2019-11-27 23:19 ` Florian Klink
  2019-12-03  6:46   ` Michael Olbrich
  2019-11-27 23:19 ` [PATCH 2/3] dts/scripts: " Florian Klink
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 21+ messages in thread
From: Florian Klink @ 2019-11-27 23:19 UTC (permalink / raw)
  To: barebox; +Cc: 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(-)

diff --git a/scripts/canon-a1100-image b/scripts/canon-a1100-image
index 6c08d7493..237ce26d8 100755
--- a/scripts/canon-a1100-image
+++ b/scripts/canon-a1100-image
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/usr/bin/env bash -e
 
 IFILE=$1
 OFILE=$2
diff --git a/scripts/check_size b/scripts/check_size
index 8530435d3..76608eccc 100755
--- a/scripts/check_size
+++ b/scripts/check_size
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
diff --git a/scripts/dfuboot.sh b/scripts/dfuboot.sh
index 524113b61..9847579ce 100755
--- a/scripts/dfuboot.sh
+++ b/scripts/dfuboot.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 DEVICETREE=
 KERNEL=
diff --git a/scripts/extract_symbol_offset b/scripts/extract_symbol_offset
index 78b866830..d0ea22434 100755
--- a/scripts/extract_symbol_offset
+++ b/scripts/extract_symbol_offset
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
diff --git a/scripts/gen-dtb-s b/scripts/gen-dtb-s
index b2dd253c2..0649247f9 100755
--- a/scripts/gen-dtb-s
+++ b/scripts/gen-dtb-s
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 name=$1
 dtb=$2
diff --git a/scripts/genenv b/scripts/genenv
index 5ebe69963..454f2327b 100755
--- a/scripts/genenv
+++ b/scripts/genenv
@@ -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>...
diff --git a/scripts/socfpga_get_sequencer b/scripts/socfpga_get_sequencer
index 36f67498b..5405bfa6b 100755
--- a/scripts/socfpga_get_sequencer
+++ b/scripts/socfpga_get_sequencer
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
diff --git a/scripts/socfpga_import_preloader b/scripts/socfpga_import_preloader
index 6c748fadb..23e3c380d 100755
--- a/scripts/socfpga_import_preloader
+++ b/scripts/socfpga_import_preloader
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
diff --git a/scripts/socfpga_xml_to_config.sh b/scripts/socfpga_xml_to_config.sh
index 7e22ebb9e..3bb0dd283 100755
--- a/scripts/socfpga_xml_to_config.sh
+++ b/scripts/socfpga_xml_to_config.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 ## TODO:
 ## - read in mpuclk and nocclk, must be calculated by hand at the moment
-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 2/3] dts/scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
  2019-11-27 23:19 use /usr/bin/env bash shebang instead of /bin/bash Florian Klink
  2019-11-27 23:19 ` [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Florian Klink
@ 2019-11-27 23:19 ` Florian Klink
  2019-11-27 23:19 ` [PATCH 3/3] docs: " Florian Klink
  2019-12-02  8:57 ` use /usr/bin/env bash shebang instead of /bin/bash Sascha Hauer
  3 siblings, 0 replies; 21+ messages in thread
From: Florian Klink @ 2019-11-27 23:19 UTC (permalink / raw)
  To: barebox; +Cc: 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(-)

diff --git a/dts/scripts/cronjob b/dts/scripts/cronjob
index ccdbc0607..b7511e425 100755
--- a/dts/scripts/cronjob
+++ b/dts/scripts/cronjob
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 
diff --git a/dts/scripts/index-filter.sh b/dts/scripts/index-filter.sh
index 961085502..c301fcea1 100755
--- a/dts/scripts/index-filter.sh
+++ b/dts/scripts/index-filter.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 set -o pipefail
diff --git a/dts/scripts/merge-new-release.sh b/dts/scripts/merge-new-release.sh
index a2763c69b..554b97b8e 100755
--- a/dts/scripts/merge-new-release.sh
+++ b/dts/scripts/merge-new-release.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 case $1 in
     v*-dts) ;;
-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 3/3] docs: use #!/usr/bin/env bash shebang instead of #!/bin/bash
  2019-11-27 23:19 use /usr/bin/env bash shebang instead of /bin/bash Florian Klink
  2019-11-27 23:19 ` [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Florian Klink
  2019-11-27 23:19 ` [PATCH 2/3] dts/scripts: " Florian Klink
@ 2019-11-27 23:19 ` Florian Klink
  2019-12-02  8:57 ` use /usr/bin/env bash shebang instead of /bin/bash Sascha Hauer
  3 siblings, 0 replies; 21+ messages in thread
From: Florian Klink @ 2019-11-27 23:19 UTC (permalink / raw)
  To: barebox; +Cc: 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(-)

diff --git a/Documentation/user/usb.rst b/Documentation/user/usb.rst
index 029e46354..4c1b2925f 100644
--- a/Documentation/user/usb.rst
+++ b/Documentation/user/usb.rst
@@ -172,7 +172,7 @@ and initrd:
 
 .. code-block:: sh
 
-  #!/bin/bash
+  #!/usr/bin/env bash
 
   set -e
   set -v
diff --git a/MAKEALL b/MAKEALL
index 909e170b1..3548739e3 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Print statistics when we exit
 trap exit 1 2 3 15
-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: use /usr/bin/env bash shebang instead of /bin/bash
  2019-11-27 23:19 use /usr/bin/env bash shebang instead of /bin/bash Florian Klink
                   ` (2 preceding siblings ...)
  2019-11-27 23:19 ` [PATCH 3/3] docs: " Florian Klink
@ 2019-12-02  8:57 ` Sascha Hauer
  2019-12-02 14:29   ` Florian Klink
  3 siblings, 1 reply; 21+ messages in thread
From: Sascha Hauer @ 2019-12-02  8:57 UTC (permalink / raw)
  To: Florian Klink; +Cc: barebox

Hi FLorian,

On Thu, Nov 28, 2019 at 12:19:43AM +0100, Florian Klink wrote:
> 
> 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

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: use /usr/bin/env bash shebang instead of /bin/bash
  2019-12-02  8:57 ` use /usr/bin/env bash shebang instead of /bin/bash Sascha Hauer
@ 2019-12-02 14:29   ` Florian Klink
  0 siblings, 0 replies; 21+ messages in thread
From: Florian Klink @ 2019-12-02 14:29 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

>> 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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
  2019-11-27 23:19 ` [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Florian Klink
@ 2019-12-03  6:46   ` Michael Olbrich
  2019-12-03  8:45     ` Sascha Hauer
  2019-12-03 12:50     ` [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Roland Hieber
  0 siblings, 2 replies; 21+ messages in thread
From: Michael Olbrich @ 2019-12-03  6:46 UTC (permalink / raw)
  To: Florian Klink; +Cc: barebox

On Thu, Nov 28, 2019 at 12:19:44AM +0100, Florian Klink wrote:
> 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(-)
> 
> diff --git a/scripts/canon-a1100-image b/scripts/canon-a1100-image
> index 6c08d7493..237ce26d8 100755
> --- a/scripts/canon-a1100-image
> +++ b/scripts/canon-a1100-image
> @@ -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

>  
>  IFILE=$1
>  OFILE=$2
> diff --git a/scripts/check_size b/scripts/check_size
> index 8530435d3..76608eccc 100755
> --- a/scripts/check_size
> +++ b/scripts/check_size
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  symbol="$1"
>  file="$2"
> diff --git a/scripts/dfuboot.sh b/scripts/dfuboot.sh
> index 524113b61..9847579ce 100755
> --- a/scripts/dfuboot.sh
> +++ b/scripts/dfuboot.sh
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  DEVICETREE=
>  KERNEL=
> diff --git a/scripts/extract_symbol_offset b/scripts/extract_symbol_offset
> index 78b866830..d0ea22434 100755
> --- a/scripts/extract_symbol_offset
> +++ b/scripts/extract_symbol_offset
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  symbol="$1"
>  file="$2"
> diff --git a/scripts/gen-dtb-s b/scripts/gen-dtb-s
> index b2dd253c2..0649247f9 100755
> --- a/scripts/gen-dtb-s
> +++ b/scripts/gen-dtb-s
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  name=$1
>  dtb=$2
> diff --git a/scripts/genenv b/scripts/genenv
> index 5ebe69963..454f2327b 100755
> --- a/scripts/genenv
> +++ b/scripts/genenv
> @@ -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>...
> diff --git a/scripts/socfpga_get_sequencer b/scripts/socfpga_get_sequencer
> index 36f67498b..5405bfa6b 100755
> --- a/scripts/socfpga_get_sequencer
> +++ b/scripts/socfpga_get_sequencer
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  if [ "$#" -lt "2" ]
>  then
> diff --git a/scripts/socfpga_import_preloader b/scripts/socfpga_import_preloader
> index 6c748fadb..23e3c380d 100755
> --- a/scripts/socfpga_import_preloader
> +++ b/scripts/socfpga_import_preloader
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  if [ "$#" -lt "2" ]
>  then
> diff --git a/scripts/socfpga_xml_to_config.sh b/scripts/socfpga_xml_to_config.sh
> index 7e22ebb9e..3bb0dd283 100755
> --- a/scripts/socfpga_xml_to_config.sh
> +++ b/scripts/socfpga_xml_to_config.sh
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  ## TODO:
>  ## - read in mpuclk and nocclk, must be calculated by hand at the moment
> -- 
> 2.24.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
  2019-12-03  6:46   ` Michael Olbrich
@ 2019-12-03  8:45     ` Sascha Hauer
  2019-12-03  9:12       ` Michael Olbrich
  2019-12-03 12:50     ` [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Roland Hieber
  1 sibling, 1 reply; 21+ messages in thread
From: Sascha Hauer @ 2019-12-03  8:45 UTC (permalink / raw)
  To: Michael Olbrich; +Cc: Florian Klink, barebox

On Tue, Dec 03, 2019 at 07:46:03AM +0100, Michael Olbrich wrote:
> On Thu, Nov 28, 2019 at 12:19:44AM +0100, Florian Klink wrote:
> > 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(-)
> > 
> > diff --git a/scripts/canon-a1100-image b/scripts/canon-a1100-image
> > index 6c08d7493..237ce26d8 100755
> > --- a/scripts/canon-a1100-image
> > +++ b/scripts/canon-a1100-image
> > @@ -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.

Why not:

#!/usr/bin/env bash

set -e

?

Sascha


-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
  2019-12-03  8:45     ` Sascha Hauer
@ 2019-12-03  9:12       ` Michael Olbrich
  2019-12-05 21:45         ` [PATCH v2 1/4] " Florian Klink
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Olbrich @ 2019-12-03  9:12 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Florian Klink, barebox

On Tue, Dec 03, 2019 at 09:45:28AM +0100, Sascha Hauer wrote:
> On Tue, Dec 03, 2019 at 07:46:03AM +0100, Michael Olbrich wrote:
> > On Thu, Nov 28, 2019 at 12:19:44AM +0100, Florian Klink wrote:
> > > 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(-)
> > > 
> > > diff --git a/scripts/canon-a1100-image b/scripts/canon-a1100-image
> > > index 6c08d7493..237ce26d8 100755
> > > --- a/scripts/canon-a1100-image
> > > +++ b/scripts/canon-a1100-image
> > > @@ -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.
> 
> Why not:
> 
> #!/usr/bin/env bash
> 
> set -e

Yes, that should work.

Michael

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
  2019-12-03  6:46   ` Michael Olbrich
  2019-12-03  8:45     ` Sascha Hauer
@ 2019-12-03 12:50     ` Roland Hieber
  1 sibling, 0 replies; 21+ messages in thread
From: Roland Hieber @ 2019-12-03 12:50 UTC (permalink / raw)
  To: Florian Klink, barebox

On Tue, Dec 03, 2019 at 07:46:03AM +0100, Michael Olbrich wrote:
> On Thu, Nov 28, 2019 at 12:19:44AM +0100, Florian Klink wrote:
> > 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(-)
> > 
> > diff --git a/scripts/canon-a1100-image b/scripts/canon-a1100-image
> > index 6c08d7493..237ce26d8 100755
> > --- a/scripts/canon-a1100-image
> > +++ b/scripts/canon-a1100-image
> > @@ -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.

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

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2 1/4] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
  2019-12-03  9:12       ` Michael Olbrich
@ 2019-12-05 21:45         ` Florian Klink
  2019-12-05 21:45           ` [PATCH v2 2/4] dts/scripts: " Florian Klink
                             ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Florian Klink @ 2019-12-05 21:45 UTC (permalink / raw)
  To: barebox; +Cc: 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        | 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(-)

diff --git a/scripts/canon-a1100-image b/scripts/canon-a1100-image
index 6c08d7493..17fd47373 100755
--- a/scripts/canon-a1100-image
+++ b/scripts/canon-a1100-image
@@ -1,4 +1,6 @@
-#!/bin/bash -e
+#!/usr/bin/env bash
+
+set -e
 
 IFILE=$1
 OFILE=$2
diff --git a/scripts/check_size b/scripts/check_size
index 8530435d3..76608eccc 100755
--- a/scripts/check_size
+++ b/scripts/check_size
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
diff --git a/scripts/dfuboot.sh b/scripts/dfuboot.sh
index 524113b61..9847579ce 100755
--- a/scripts/dfuboot.sh
+++ b/scripts/dfuboot.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 DEVICETREE=
 KERNEL=
diff --git a/scripts/extract_symbol_offset b/scripts/extract_symbol_offset
index 78b866830..d0ea22434 100755
--- a/scripts/extract_symbol_offset
+++ b/scripts/extract_symbol_offset
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
diff --git a/scripts/gen-dtb-s b/scripts/gen-dtb-s
index b2dd253c2..0649247f9 100755
--- a/scripts/gen-dtb-s
+++ b/scripts/gen-dtb-s
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 name=$1
 dtb=$2
diff --git a/scripts/genenv b/scripts/genenv
index 5ebe69963..454f2327b 100755
--- a/scripts/genenv
+++ b/scripts/genenv
@@ -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>...
diff --git a/scripts/socfpga_get_sequencer b/scripts/socfpga_get_sequencer
index 36f67498b..5405bfa6b 100755
--- a/scripts/socfpga_get_sequencer
+++ b/scripts/socfpga_get_sequencer
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
diff --git a/scripts/socfpga_import_preloader b/scripts/socfpga_import_preloader
index 6c748fadb..23e3c380d 100755
--- a/scripts/socfpga_import_preloader
+++ b/scripts/socfpga_import_preloader
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
diff --git a/scripts/socfpga_xml_to_config.sh b/scripts/socfpga_xml_to_config.sh
index 7e22ebb9e..3bb0dd283 100755
--- a/scripts/socfpga_xml_to_config.sh
+++ b/scripts/socfpga_xml_to_config.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 ## TODO:
 ## - read in mpuclk and nocclk, must be calculated by hand at the moment
-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2 2/4] dts/scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
  2019-12-05 21:45         ` [PATCH v2 1/4] " Florian Klink
@ 2019-12-05 21:45           ` Florian Klink
  2019-12-05 21:45           ` [PATCH v2 3/4] docs: " Florian Klink
                             ` (2 subsequent siblings)
  3 siblings, 0 replies; 21+ messages in thread
From: Florian Klink @ 2019-12-05 21:45 UTC (permalink / raw)
  To: barebox; +Cc: 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(-)

diff --git a/dts/scripts/cronjob b/dts/scripts/cronjob
index ccdbc0607..b7511e425 100755
--- a/dts/scripts/cronjob
+++ b/dts/scripts/cronjob
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 
diff --git a/dts/scripts/index-filter.sh b/dts/scripts/index-filter.sh
index 961085502..c301fcea1 100755
--- a/dts/scripts/index-filter.sh
+++ b/dts/scripts/index-filter.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 set -o pipefail
diff --git a/dts/scripts/merge-new-release.sh b/dts/scripts/merge-new-release.sh
index a2763c69b..554b97b8e 100755
--- a/dts/scripts/merge-new-release.sh
+++ b/dts/scripts/merge-new-release.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 case $1 in
     v*-dts) ;;
-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2 3/4] docs: use #!/usr/bin/env bash shebang instead of #!/bin/bash
  2019-12-05 21:45         ` [PATCH v2 1/4] " Florian Klink
  2019-12-05 21:45           ` [PATCH v2 2/4] dts/scripts: " Florian Klink
@ 2019-12-05 21:45           ` Florian Klink
  2019-12-05 21:45           ` [PATCH v2 4/4] docs: use #!/usr/bin/env python shebang instead of #!/usr/bin/python Florian Klink
  2019-12-06 11:31           ` [PATCH v2 1/4] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Roland Hieber
  3 siblings, 0 replies; 21+ messages in thread
From: Florian Klink @ 2019-12-05 21:45 UTC (permalink / raw)
  To: barebox; +Cc: 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(-)

diff --git a/Documentation/user/usb.rst b/Documentation/user/usb.rst
index 029e46354..4c1b2925f 100644
--- a/Documentation/user/usb.rst
+++ b/Documentation/user/usb.rst
@@ -172,7 +172,7 @@ and initrd:
 
 .. code-block:: sh
 
-  #!/bin/bash
+  #!/usr/bin/env bash
 
   set -e
   set -v
diff --git a/MAKEALL b/MAKEALL
index 909e170b1..3548739e3 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Print statistics when we exit
 trap exit 1 2 3 15
-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v2 4/4] docs: use #!/usr/bin/env python shebang instead of #!/usr/bin/python
  2019-12-05 21:45         ` [PATCH v2 1/4] " Florian Klink
  2019-12-05 21:45           ` [PATCH v2 2/4] dts/scripts: " Florian Klink
  2019-12-05 21:45           ` [PATCH v2 3/4] docs: " Florian Klink
@ 2019-12-05 21:45           ` Florian Klink
  2019-12-06 11:31           ` [PATCH v2 1/4] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Roland Hieber
  3 siblings, 0 replies; 21+ messages in thread
From: Florian Klink @ 2019-12-05 21:45 UTC (permalink / raw)
  To: barebox; +Cc: 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(-)

diff --git a/Documentation/gen_commands.py b/Documentation/gen_commands.py
index 203a39bb1..a55b1acd8 100755
--- a/Documentation/gen_commands.py
+++ b/Documentation/gen_commands.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 from __future__ import print_function
 
-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v2 1/4] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
  2019-12-05 21:45         ` [PATCH v2 1/4] " Florian Klink
                             ` (2 preceding siblings ...)
  2019-12-05 21:45           ` [PATCH v2 4/4] docs: use #!/usr/bin/env python shebang instead of #!/usr/bin/python Florian Klink
@ 2019-12-06 11:31           ` Roland Hieber
  2019-12-06 12:32             ` use #!/usr/bin/env binary instead of #!/usr/bin/binary Florian Klink
  3 siblings, 1 reply; 21+ messages in thread
From: Roland Hieber @ 2019-12-06 11:31 UTC (permalink / raw)
  To: Florian Klink; +Cc: barebox

On Thu, Dec 05, 2019 at 10:45:47PM +0100, Florian Klink wrote:
> 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

> ---
>  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(-)
> 
> diff --git a/scripts/canon-a1100-image b/scripts/canon-a1100-image
> index 6c08d7493..17fd47373 100755
> --- a/scripts/canon-a1100-image
> +++ b/scripts/canon-a1100-image
> @@ -1,4 +1,6 @@
> -#!/bin/bash -e
> +#!/usr/bin/env bash
> +
> +set -e
>  
>  IFILE=$1
>  OFILE=$2
> diff --git a/scripts/check_size b/scripts/check_size
> index 8530435d3..76608eccc 100755
> --- a/scripts/check_size
> +++ b/scripts/check_size
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  symbol="$1"
>  file="$2"
> diff --git a/scripts/dfuboot.sh b/scripts/dfuboot.sh
> index 524113b61..9847579ce 100755
> --- a/scripts/dfuboot.sh
> +++ b/scripts/dfuboot.sh
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  DEVICETREE=
>  KERNEL=
> diff --git a/scripts/extract_symbol_offset b/scripts/extract_symbol_offset
> index 78b866830..d0ea22434 100755
> --- a/scripts/extract_symbol_offset
> +++ b/scripts/extract_symbol_offset
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  symbol="$1"
>  file="$2"
> diff --git a/scripts/gen-dtb-s b/scripts/gen-dtb-s
> index b2dd253c2..0649247f9 100755
> --- a/scripts/gen-dtb-s
> +++ b/scripts/gen-dtb-s
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  name=$1
>  dtb=$2
> diff --git a/scripts/genenv b/scripts/genenv
> index 5ebe69963..454f2327b 100755
> --- a/scripts/genenv
> +++ b/scripts/genenv
> @@ -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>...
> diff --git a/scripts/socfpga_get_sequencer b/scripts/socfpga_get_sequencer
> index 36f67498b..5405bfa6b 100755
> --- a/scripts/socfpga_get_sequencer
> +++ b/scripts/socfpga_get_sequencer
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  if [ "$#" -lt "2" ]
>  then
> diff --git a/scripts/socfpga_import_preloader b/scripts/socfpga_import_preloader
> index 6c748fadb..23e3c380d 100755
> --- a/scripts/socfpga_import_preloader
> +++ b/scripts/socfpga_import_preloader
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  if [ "$#" -lt "2" ]
>  then
> diff --git a/scripts/socfpga_xml_to_config.sh b/scripts/socfpga_xml_to_config.sh
> index 7e22ebb9e..3bb0dd283 100755
> --- a/scripts/socfpga_xml_to_config.sh
> +++ b/scripts/socfpga_xml_to_config.sh
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  
>  ## TODO:
>  ## - read in mpuclk and nocclk, must be calculated by hand at the moment
> -- 
> 2.24.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* use #!/usr/bin/env binary instead of #!/usr/bin/binary
  2019-12-06 11:31           ` [PATCH v2 1/4] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Roland Hieber
@ 2019-12-06 12:32             ` Florian Klink
  2019-12-06 12:32               ` [PATCH v3 1/4] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Florian Klink
                                 ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Florian Klink @ 2019-12-06 12:32 UTC (permalink / raw)
  To: barebox


This adds the missing Signed-off-by Tag to all patches. Sorry for the
noise.



_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v3 1/4] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
  2019-12-06 12:32             ` use #!/usr/bin/env binary instead of #!/usr/bin/binary Florian Klink
@ 2019-12-06 12:32               ` Florian Klink
  2019-12-06 12:32               ` [PATCH v3 2/4] dts/scripts: " Florian Klink
                                 ` (3 subsequent siblings)
  4 siblings, 0 replies; 21+ messages in thread
From: Florian Klink @ 2019-12-06 12:32 UTC (permalink / raw)
  To: barebox; +Cc: 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.

Signed-off-by: Florian Klink <flokli@flokli.de>
---
 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(-)

diff --git a/scripts/canon-a1100-image b/scripts/canon-a1100-image
index 6c08d7493..17fd47373 100755
--- a/scripts/canon-a1100-image
+++ b/scripts/canon-a1100-image
@@ -1,4 +1,6 @@
-#!/bin/bash -e
+#!/usr/bin/env bash
+
+set -e
 
 IFILE=$1
 OFILE=$2
diff --git a/scripts/check_size b/scripts/check_size
index 8530435d3..76608eccc 100755
--- a/scripts/check_size
+++ b/scripts/check_size
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
diff --git a/scripts/dfuboot.sh b/scripts/dfuboot.sh
index 524113b61..9847579ce 100755
--- a/scripts/dfuboot.sh
+++ b/scripts/dfuboot.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 DEVICETREE=
 KERNEL=
diff --git a/scripts/extract_symbol_offset b/scripts/extract_symbol_offset
index 78b866830..d0ea22434 100755
--- a/scripts/extract_symbol_offset
+++ b/scripts/extract_symbol_offset
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 symbol="$1"
 file="$2"
diff --git a/scripts/gen-dtb-s b/scripts/gen-dtb-s
index b2dd253c2..0649247f9 100755
--- a/scripts/gen-dtb-s
+++ b/scripts/gen-dtb-s
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 name=$1
 dtb=$2
diff --git a/scripts/genenv b/scripts/genenv
index 5ebe69963..454f2327b 100755
--- a/scripts/genenv
+++ b/scripts/genenv
@@ -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>...
diff --git a/scripts/socfpga_get_sequencer b/scripts/socfpga_get_sequencer
index 36f67498b..5405bfa6b 100755
--- a/scripts/socfpga_get_sequencer
+++ b/scripts/socfpga_get_sequencer
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
diff --git a/scripts/socfpga_import_preloader b/scripts/socfpga_import_preloader
index 6c748fadb..23e3c380d 100755
--- a/scripts/socfpga_import_preloader
+++ b/scripts/socfpga_import_preloader
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 if [ "$#" -lt "2" ]
 then
diff --git a/scripts/socfpga_xml_to_config.sh b/scripts/socfpga_xml_to_config.sh
index 7e22ebb9e..3bb0dd283 100755
--- a/scripts/socfpga_xml_to_config.sh
+++ b/scripts/socfpga_xml_to_config.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 ## TODO:
 ## - read in mpuclk and nocclk, must be calculated by hand at the moment
-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v3 2/4] dts/scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash
  2019-12-06 12:32             ` use #!/usr/bin/env binary instead of #!/usr/bin/binary Florian Klink
  2019-12-06 12:32               ` [PATCH v3 1/4] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Florian Klink
@ 2019-12-06 12:32               ` Florian Klink
  2019-12-06 12:32               ` [PATCH v3 3/4] docs: " Florian Klink
                                 ` (2 subsequent siblings)
  4 siblings, 0 replies; 21+ messages in thread
From: Florian Klink @ 2019-12-06 12:32 UTC (permalink / raw)
  To: barebox; +Cc: 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.

Signed-off-by: Florian Klink <flokli@flokli.de>
---
 dts/scripts/cronjob              | 2 +-
 dts/scripts/index-filter.sh      | 2 +-
 dts/scripts/merge-new-release.sh | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dts/scripts/cronjob b/dts/scripts/cronjob
index ccdbc0607..b7511e425 100755
--- a/dts/scripts/cronjob
+++ b/dts/scripts/cronjob
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 
diff --git a/dts/scripts/index-filter.sh b/dts/scripts/index-filter.sh
index 961085502..c301fcea1 100755
--- a/dts/scripts/index-filter.sh
+++ b/dts/scripts/index-filter.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e
 set -o pipefail
diff --git a/dts/scripts/merge-new-release.sh b/dts/scripts/merge-new-release.sh
index a2763c69b..554b97b8e 100755
--- a/dts/scripts/merge-new-release.sh
+++ b/dts/scripts/merge-new-release.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 case $1 in
     v*-dts) ;;
-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v3 3/4] docs: use #!/usr/bin/env bash shebang instead of #!/bin/bash
  2019-12-06 12:32             ` use #!/usr/bin/env binary instead of #!/usr/bin/binary Florian Klink
  2019-12-06 12:32               ` [PATCH v3 1/4] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Florian Klink
  2019-12-06 12:32               ` [PATCH v3 2/4] dts/scripts: " Florian Klink
@ 2019-12-06 12:32               ` Florian Klink
  2019-12-06 12:32               ` [PATCH v3 4/4] docs: use #!/usr/bin/env python shebang instead of #!/usr/bin/python Florian Klink
  2019-12-06 14:25               ` use #!/usr/bin/env binary instead of #!/usr/bin/binary Sascha Hauer
  4 siblings, 0 replies; 21+ messages in thread
From: Florian Klink @ 2019-12-06 12:32 UTC (permalink / raw)
  To: barebox; +Cc: 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.

Signed-off-by: Florian Klink <flokli@flokli.de>
---
 Documentation/user/usb.rst | 2 +-
 MAKEALL                    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/user/usb.rst b/Documentation/user/usb.rst
index 029e46354..4c1b2925f 100644
--- a/Documentation/user/usb.rst
+++ b/Documentation/user/usb.rst
@@ -172,7 +172,7 @@ and initrd:
 
 .. code-block:: sh
 
-  #!/bin/bash
+  #!/usr/bin/env bash
 
   set -e
   set -v
diff --git a/MAKEALL b/MAKEALL
index 909e170b1..3548739e3 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Print statistics when we exit
 trap exit 1 2 3 15
-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v3 4/4] docs: use #!/usr/bin/env python shebang instead of #!/usr/bin/python
  2019-12-06 12:32             ` use #!/usr/bin/env binary instead of #!/usr/bin/binary Florian Klink
                                 ` (2 preceding siblings ...)
  2019-12-06 12:32               ` [PATCH v3 3/4] docs: " Florian Klink
@ 2019-12-06 12:32               ` Florian Klink
  2019-12-06 14:25               ` use #!/usr/bin/env binary instead of #!/usr/bin/binary Sascha Hauer
  4 siblings, 0 replies; 21+ messages in thread
From: Florian Klink @ 2019-12-06 12:32 UTC (permalink / raw)
  To: barebox; +Cc: 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.

Signed-off-by: Florian Klink <flokli@flokli.de>
---
 Documentation/gen_commands.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/gen_commands.py b/Documentation/gen_commands.py
index 203a39bb1..a55b1acd8 100755
--- a/Documentation/gen_commands.py
+++ b/Documentation/gen_commands.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 
 from __future__ import print_function
 
-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: use #!/usr/bin/env binary instead of #!/usr/bin/binary
  2019-12-06 12:32             ` use #!/usr/bin/env binary instead of #!/usr/bin/binary Florian Klink
                                 ` (3 preceding siblings ...)
  2019-12-06 12:32               ` [PATCH v3 4/4] docs: use #!/usr/bin/env python shebang instead of #!/usr/bin/python Florian Klink
@ 2019-12-06 14:25               ` Sascha Hauer
  4 siblings, 0 replies; 21+ messages in thread
From: Sascha Hauer @ 2019-12-06 14:25 UTC (permalink / raw)
  To: Florian Klink; +Cc: barebox

On Fri, Dec 06, 2019 at 01:32:51PM +0100, Florian Klink wrote:
> 
> This adds the missing Signed-off-by Tag to all patches. Sorry for the
> noise.

Applied, thanks

Sascha


-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2019-12-06 14:25 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-27 23:19 use /usr/bin/env bash shebang instead of /bin/bash Florian Klink
2019-11-27 23:19 ` [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Florian Klink
2019-12-03  6:46   ` Michael Olbrich
2019-12-03  8:45     ` Sascha Hauer
2019-12-03  9:12       ` Michael Olbrich
2019-12-05 21:45         ` [PATCH v2 1/4] " Florian Klink
2019-12-05 21:45           ` [PATCH v2 2/4] dts/scripts: " Florian Klink
2019-12-05 21:45           ` [PATCH v2 3/4] docs: " Florian Klink
2019-12-05 21:45           ` [PATCH v2 4/4] docs: use #!/usr/bin/env python shebang instead of #!/usr/bin/python Florian Klink
2019-12-06 11:31           ` [PATCH v2 1/4] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Roland Hieber
2019-12-06 12:32             ` use #!/usr/bin/env binary instead of #!/usr/bin/binary Florian Klink
2019-12-06 12:32               ` [PATCH v3 1/4] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Florian Klink
2019-12-06 12:32               ` [PATCH v3 2/4] dts/scripts: " Florian Klink
2019-12-06 12:32               ` [PATCH v3 3/4] docs: " Florian Klink
2019-12-06 12:32               ` [PATCH v3 4/4] docs: use #!/usr/bin/env python shebang instead of #!/usr/bin/python Florian Klink
2019-12-06 14:25               ` use #!/usr/bin/env binary instead of #!/usr/bin/binary Sascha Hauer
2019-12-03 12:50     ` [PATCH 1/3] scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bash Roland Hieber
2019-11-27 23:19 ` [PATCH 2/3] dts/scripts: " Florian Klink
2019-11-27 23:19 ` [PATCH 3/3] docs: " Florian Klink
2019-12-02  8:57 ` use /usr/bin/env bash shebang instead of /bin/bash Sascha Hauer
2019-12-02 14:29   ` Florian Klink

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox