support/scripts: fix shebang with bash
PATCH 1/1 support/scripts: fix shebang with bash
--- support/scripts/br2-external | 2 +- support/scripts/check-bin-arch | 2 +- support/scripts/fix-configure-powerpc64.sh | 2 +- support/scripts/genimage.sh | 2 +- support/scripts/hardlink-or-copy | 2 +- support/scripts/test-pkg | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
support/scripts/br2-external +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e # This script must be able to run with bash-3.1, so it can't use
support/scripts/check-bin-arch +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash while getopts p:l:r:a: OPT ; do case "${OPT}" in
support/scripts/fix-configure-powerpc64.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This is a script to find, and correct, a problem with old versions of # configure that affect powerpc64 and powerpc64le.
support/scripts/genimage.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash die() { echo "Error: $@" >&2
support/scripts/hardlink-or-copy +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Try to hardlink a file into a directory, fallback to copy on failure. #
support/scripts/test-pkg +1 -1
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e TOOLCHAINS_URL='http://autobuild.buildroot.org/toolchains/configs/toolchain-configs.csv'
Signature · 1 line
2.12.2
PATCH 1/1 support/scripts: fix shebang with bash
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Francois" == Francois Perrad <[email protected]> writes:
Signed-off-by Francois Perrad <[email protected]>
Out of interest, what distribution doesn't have bash in /bin? #!/bin/bash is a quite common shebang, and we use it in several places outside support/scripts.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/1 support/scripts: fix shebang with bash
2017-06-08 16:47 GMT+02:00 Peter Korsgaard <[email protected]>:
Quoted 9 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Francois" == Francois Perrad <[email protected]> writes:
Signed-off-by Francois Perrad <[email protected]>Out of interest, what distribution doesn't have bash in /bin? #!/bin/bash is a quite common shebang, and we use it in several places outside support/scripts.
I found this issue with NixOS (http://nixos.org/) where:
$ ls /bin sh $ ls /usr/bin env $ which bash /run/current-system/sw/bin/bash $ which which /run/current-system/sw/bin/which
so, #!/bin/sh is the only shebang which doesn't require to start with #!/usr/bin/env
Fran?ois
Quoted 7 lines
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170608/e352d69e/attachment.html>
PATCH 1/1 support/scripts: fix shebang with bash
Quoted 22 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Fran?ois" == Fran?ois Perrad <[email protected]> writes:
2017-06-08 16:47 GMT+02:00 Peter Korsgaard <[email protected]>:
Quoted 9 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Francois" == Francois Perrad <[email protected]> writes:
Signed-off-by Francois Perrad <[email protected]>Out of interest, what distribution doesn't have bash in /bin? #!/bin/bash is a quite common shebang, and we use it in several places outside support/scripts.
I found this issue with NixOS (http://nixos.org/) where:
$ ls /bin sh $ ls /usr/bin env $ which bash /run/current-system/sw/bin/bash $ which which /run/current-system/sw/bin/which
Quoted 2 lines
so, #!/bin/sh is the only shebang which doesn't require to start with #!/usr/bin/env
And /bin/sh is a symlink to /run/current-system/sw/bin/bash? Otherwise I don't understand how the logic in Makefile and support/dependencies/dependencies.sh could work?
What about packages? Are there no package build systems that hardcodes /bin/bash?
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/1 support/scripts: fix shebang with bash
2017-06-08 23:58 GMT+02:00 Peter Korsgaard <[email protected]>:
Quoted 22 lines
Quoted 21 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Fran?ois" == Fran?ois Perrad <[email protected]> writes:
2017-06-08 16:47 GMT+02:00 Peter Korsgaard <[email protected]>:
Quoted 9 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Francois" == Francois Perrad <[email protected]> writes:
Signed-off-by Francois Perrad <[email protected]>Out of interest, what distribution doesn't have bash in /bin? #!/bin/bash is a quite common shebang, and we use it in several places outside support/scripts.
I found this issue with NixOS (http://nixos.org/) where:
$ ls /bin sh $ ls /usr/bin env $ which bash /run/current-system/sw/bin/bash $ which which /run/current-system/sw/bin/which
Quoted 7 lines
Quoted 2 lines
so, #!/bin/sh is the only shebang which doesn't require to start with #!/usr/bin/env
And
/bin/shis a symlink to/run/current-system/sw/bin/bash? Otherwise I don't understand how the logic inMakefileandsupport/dependencies/dependencies.shcould work?
/bin/sh is a symlink to /nix/store/bxr5lwdhhgfh1p28mh3w7kyc0spk7niz-bash-4.4-p5/bin/sh /run/current-system/sw/bin/bash is a symlink to /nix/store/bxr5lwdhhgfh1p28mh3w7kyc0spk7niz-bash-4.4-p5/bin/bash
Quoted 4 lines
What about packages? Are there no package build systems that hardcodes
/bin/bash?
No.
Packages needed by Buildroot could be declared like this :
https://github.com/fperrad/misc/blob/master/nix/buildroot.nix
Fran?ois
Quoted 4 lines
--
Bye, Peter Korsgaard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170609/65605813/attachment.html>
PATCH 1/1 support/scripts: fix shebang with bash
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Fran?ois" == Fran?ois Perrad <[email protected]> writes:
Hi,
Quoted 9 lines
Quoted 4 lines
And
/bin/shis a symlink to/run/current-system/sw/bin/bash? Otherwise I don't understand how the logic inMakefileandsupport/dependencies/dependencies.shcould work?
/bin/shis a symlink to /nix/store/bxr5lwdhhgfh1p28mh3w7kyc0spk7niz-bash-4.4-p5/bin/sh/run/current-system/sw/bin/bashis a symlink to /nix/store/bxr5lwdhhgfh1p28mh3w7kyc0spk7niz-bash-4.4-p5/bin/bash
Ok, and than ../bin/sh is presumably a symlink to ../bin/bash?
Quoted 7 lines
Quoted 3 lines
What about packages? Are there no package build systems that hardcodes
/bin/bash?No.
Packages needed by Buildroot could be declared like this :
https://github.com/fperrad/misc/blob/master/nix/buildroot.nix
What I mean is that seeing scripts with the #!/bin/bash shebang is quite common, so I wouldn't be surprised if some of the upstream build systems used by some of the packages we have in buildroot use that.
For one, some of our board specific scripts use it:
board/stmicroelectronics/stm32f429-disco/flash.sh:#!/bin/bash board/stmicroelectronics/stm32f469-disco/flash.sh:#!/bin/bash board/technologic/ts4800/post-image.sh:#!/bin/bash board/technologic/ts4900/post-image.sh:#!/bin/bash
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/1 support/scripts: fix shebang with bash
In reply to Francois PerradFran?ois, All,
On 2017-06-05 09:37 +0200, Francois Perrad spake thusly:
Quoted 1 line
Signed-off-by Francois Perrad <[email protected]>
Regards,
Yann E. MORIN.
Quoted 76 lines
--- support/scripts/br2-external | 2 +- support/scripts/check-bin-arch | 2 +- support/scripts/fix-configure-powerpc64.sh | 2 +- support/scripts/genimage.sh | 2 +- support/scripts/hardlink-or-copy | 2 +- support/scripts/test-pkg | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)support/scripts/br2-external +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e # This script must be able to run with bash-3.1, so it can't usesupport/scripts/check-bin-arch +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash while getopts p:l:r:a: OPT ; do case "${OPT}" insupport/scripts/fix-configure-powerpc64.sh +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This is a script to find, and correct, a problem with old versions of # configure that affect powerpc64 and powerpc64le.support/scripts/genimage.sh +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash die() { echo "Error: $@" >&2support/scripts/hardlink-or-copy +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Try to hardlink a file into a directory, fallback to copy on failure. #support/scripts/test-pkg +1
-1@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e TOOLCHAINS_URL='http://autobuild.buildroot.org/toolchains/configs/toolchain-configs.csv'Signature · 6 lines
2.12.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
Thomas Petazzoni
AppliedPATCH 1/1 support/scripts: fix shebang with bash
In reply to Francois PerradHello,
Quoted 9 lines · Francois Perrad
Signed-off-by Francois Perrad <[email protected]>--- support/scripts/br2-external | 2 +- support/scripts/check-bin-arch | 2 +- support/scripts/fix-configure-powerpc64.sh | 2 +- support/scripts/genimage.sh | 2 +- support/scripts/hardlink-or-copy | 2 +- support/scripts/test-pkg | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com