Skip to contentSkip to conversation

Change /bin/bash shebangs into /usr/bin/env bash

PATCH New Bjørn Forsman 3 participants 3 messages Oct 21, 2014 – Oct 24, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Change /bin/bash shebangs into /usr/bin/env bash

Not all systems have /bin/bash (e.g. NixOS[1] doesn't). Buildroot already uses /usr/bin/env shebangs for other interpreters (perl, python), so why not bash?

This changes only the shebangs used by Buildroot itself; stuff installed to the target system is left unchanged.

With this applied I can run Buildroot unmodified on NixOS.

[1]: http://nixos.org/

---
 support/download/bzr                  | 2 +-
 support/download/check-hash           | 2 +-
 support/download/cp                   | 2 +-
 support/download/cvs                  | 2 +-
 support/download/git                  | 2 +-
 support/download/hg                   | 2 +-
 support/download/scp                  | 2 +-
 support/download/svn                  | 2 +-
 support/download/wget                 | 2 +-
 support/download/wrapper              | 2 +-
 support/scripts/apply-patches.sh      | 2 +-
 support/scripts/expunge-gconv-modules | 2 +-
 support/scripts/mkusers               | 2 +-
 support/scripts/pkg-stats             | 2 +-
 14 files changed, 14 insertions(+), 14 deletions(-)
support/download/bzr +1 -1
index b545cb1..c157ca8 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/check-hash +1 -1
index f1e0c1b..067e7a2 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 # Helper to check a file matches its known hash
support/download/cp +1 -1
index 264f5dc..463fc38 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/cvs +1 -1
index c92d491..56a11c2 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/git +1 -1
index ff6b5c3..5d36ca4 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/hg +1 -1
index 747dd34..66bd2ed 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/scp +1 -1
index 1676929..f3e92f3 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/svn +1 -1
index 3a9512d..a960f7d 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/wget +1 -1
index 2cea100..6b73726 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/wrapper +1 -1
index 8ae2797..320a37e 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # This script is a wrapper to the other download helpers.
 # Its role is to ensure atomicity when saving downloaded files
support/scripts/apply-patches.sh +1 -1
index 37f2d81..8cc09cb 100755
@@ -1,4 +1,4 @@
-#! /bin/bash
+#!/usr/bin/env bash
 # A little script I whipped up to make it easy to
 # patch source trees and have sane error handling
 # -Erik
support/scripts/expunge-gconv-modules +1 -1
index a77b063..03012c1 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # This script is used to generate a gconv-modules file that takes into
 # account only the gconv modules installed by Buildroot. It receives
support/scripts/mkusers +1 -1
index ffd192d..1fd324e 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 myname="${0##*/}"
 
support/scripts/pkg-stats +1 -1
index f6d10bb..48a5536 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Copyright (C) 2009 by Thomas Petazzoni <[email protected]>
 #
Signature · 1 line
2.1.2
#1 lore raw

PATCH 1/1 Change /bin/bash shebangs into /usr/bin/env bash

Bj?rn, All,

On 2014-10-21 16:05 +0200, Bj?rn Forsman spake thusly:

Quoted 4 lines

Not all systems have /bin/bash (e.g. NixOS[1] doesn't). Buildroot already uses /usr/bin/env shebangs for other interpreters (perl, python), so why not bash?

Quoted 8 lines

This changes only the shebangs used by Buildroot itself; stuff installed to the target system is left unchanged.

With this applied I can run Buildroot unmodified on NixOS.

[1]: http://nixos.org/

Bizarely enough, all but two are scripts I wrote. :-]

Regards,
Yann E. MORIN.

Quoted 164 lines
---
 support/download/bzr                  | 2 +-
 support/download/check-hash           | 2 +-
 support/download/cp                   | 2 +-
 support/download/cvs                  | 2 +-
 support/download/git                  | 2 +-
 support/download/hg                   | 2 +-
 support/download/scp                  | 2 +-
 support/download/svn                  | 2 +-
 support/download/wget                 | 2 +-
 support/download/wrapper              | 2 +-
 support/scripts/apply-patches.sh      | 2 +-
 support/scripts/expunge-gconv-modules | 2 +-
 support/scripts/mkusers               | 2 +-
 support/scripts/pkg-stats             | 2 +-
 14 files changed, 14 insertions(+), 14 deletions(-)
support/download/bzr +1 -1
index b545cb1..c157ca8 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/check-hash +1 -1
index f1e0c1b..067e7a2 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 # Helper to check a file matches its known hash
support/download/cp +1 -1
index 264f5dc..463fc38 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/cvs +1 -1
index c92d491..56a11c2 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/git +1 -1
index ff6b5c3..5d36ca4 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/hg +1 -1
index 747dd34..66bd2ed 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/scp +1 -1
index 1676929..f3e92f3 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/svn +1 -1
index 3a9512d..a960f7d 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/wget +1 -1
index 2cea100..6b73726 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # We want to catch any unexpected failure, and exit immediately
 set -e
support/download/wrapper +1 -1
index 8ae2797..320a37e 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # This script is a wrapper to the other download helpers.
 # Its role is to ensure atomicity when saving downloaded files
support/scripts/apply-patches.sh +1 -1
index 37f2d81..8cc09cb 100755
@@ -1,4 +1,4 @@
-#! /bin/bash
+#!/usr/bin/env bash
 # A little script I whipped up to make it easy to
 # patch source trees and have sane error handling
 # -Erik
support/scripts/expunge-gconv-modules +1 -1
index a77b063..03012c1 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # This script is used to generate a gconv-modules file that takes into
 # account only the gconv modules installed by Buildroot. It receives
support/scripts/mkusers +1 -1
index ffd192d..1fd324e 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 myname="${0##*/}"
 
support/scripts/pkg-stats +1 -1
index f6d10bb..48a5536 100755
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Copyright (C) 2009 by Thomas Petazzoni <[email protected]>
 #
Signature · 6 lines
2.1.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.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 Change /bin/bash shebangs into /usr/bin/env bash

In reply to Bjørn Forsman
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Bj?rn" == Bj?rn Forsman <[email protected]> writes:

Not all systems have /bin/bash (e.g. NixOS[1] doesn't). Buildroot already uses /usr/bin/env shebangs for other interpreters (perl, python), so why not bash?

Quoted 8 lines

This changes only the shebangs used by Buildroot itself; stuff installed to the target system is left unchanged.

With this applied I can run Buildroot unmodified on NixOS.

[1]: http://nixos.org/

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard