Development discussion of WireGuard
 help / color / mirror / Atom feed
From: "Jörg Thalheim" <joerg@higgsboson.tk>
To: wireguard@lists.zx2c4.com
Subject: [PATCH] treewide: more portable bash shebangs
Date: Tue, 16 Jul 2019 13:21:34 +0100	[thread overview]
Message-ID: <ff30a296-bdb9-3b13-5fb1-636a520300c0@higgsboson.tk> (raw)

While /usr/bin/env is more or less available on all POSIX systems
/bin/bash might not be. This is particular the case on NixOS and the BSD
family (/usr/local/bin/bash). Downstream packagers would often rewrite
those shebangs back automatically as they can rely on absolute paths
but having portable shebangs in the repository helps to run the code
without any further modification.

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
 contrib/examples/dns-hatchet/apply.sh                     | 2 +-
 contrib/examples/extract-handshakes/extract-handshakes.sh | 2 +-
 contrib/examples/json/wg-json                             | 2 +-
 contrib/examples/ncat-client-server/client.sh             | 2 +-
 contrib/examples/ncat-client-server/server.sh             | 2 +-
 contrib/examples/reresolve-dns/reresolve-dns.sh           | 2 +-
 contrib/examples/synergy/synergy-client.sh                | 2 +-
 contrib/examples/synergy/synergy-server.sh                | 2 +-
 contrib/kernel-tree/create-patch.sh                       | 2 +-
 contrib/kernel-tree/filter-compat-defines.sh              | 2 +-
 contrib/kernel-tree/jury-rig.sh                           | 2 +-
 src/tests/netns.sh                                        | 2 +-
 src/tools/wg-quick/linux.bash                             | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/contrib/examples/dns-hatchet/apply.sh b/contrib/examples/dns-hatchet/apply.sh
index 2bf002d..fb4ca34 100755
--- a/contrib/examples/dns-hatchet/apply.sh
+++ b/contrib/examples/dns-hatchet/apply.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
diff --git a/contrib/examples/extract-handshakes/extract-handshakes.sh b/contrib/examples/extract-handshakes/extract-handshakes.sh
index f794ffe..289907e 100755
--- a/contrib/examples/extract-handshakes/extract-handshakes.sh
+++ b/contrib/examples/extract-handshakes/extract-handshakes.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
diff --git a/contrib/examples/json/wg-json b/contrib/examples/json/wg-json
index 8b35521..f4d86a1 100755
--- a/contrib/examples/json/wg-json
+++ b/contrib/examples/json/wg-json
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
diff --git a/contrib/examples/ncat-client-server/client.sh b/contrib/examples/ncat-client-server/client.sh
index dd0f575..1a5f3ed 100755
--- a/contrib/examples/ncat-client-server/client.sh
+++ b/contrib/examples/ncat-client-server/client.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
diff --git a/contrib/examples/ncat-client-server/server.sh b/contrib/examples/ncat-client-server/server.sh
index 38a69e1..e710661 100755
--- a/contrib/examples/ncat-client-server/server.sh
+++ b/contrib/examples/ncat-client-server/server.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
diff --git a/contrib/examples/reresolve-dns/reresolve-dns.sh b/contrib/examples/reresolve-dns/reresolve-dns.sh
index e579f86..28ee389 100755
--- a/contrib/examples/reresolve-dns/reresolve-dns.sh
+++ b/contrib/examples/reresolve-dns/reresolve-dns.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
diff --git a/contrib/examples/synergy/synergy-client.sh b/contrib/examples/synergy/synergy-client.sh
index de358ef..ecaf337 100755
--- a/contrib/examples/synergy/synergy-client.sh
+++ b/contrib/examples/synergy/synergy-client.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
diff --git a/contrib/examples/synergy/synergy-server.sh b/contrib/examples/synergy/synergy-server.sh
index e04b1f4..0404996 100755
--- a/contrib/examples/synergy/synergy-server.sh
+++ b/contrib/examples/synergy/synergy-server.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
diff --git a/contrib/kernel-tree/create-patch.sh b/contrib/kernel-tree/create-patch.sh
index 4a4ad98..cc7e35f 100755
--- a/contrib/kernel-tree/create-patch.sh
+++ b/contrib/kernel-tree/create-patch.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
diff --git a/contrib/kernel-tree/filter-compat-defines.sh b/contrib/kernel-tree/filter-compat-defines.sh
index d083bf5..b1747b5 100755
--- a/contrib/kernel-tree/filter-compat-defines.sh
+++ b/contrib/kernel-tree/filter-compat-defines.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
diff --git a/contrib/kernel-tree/jury-rig.sh b/contrib/kernel-tree/jury-rig.sh
index 2b16f88..021830a 100755
--- a/contrib/kernel-tree/jury-rig.sh
+++ b/contrib/kernel-tree/jury-rig.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
diff --git a/src/tests/netns.sh b/src/tests/netns.sh
index 7cbbfce..7e0e166 100755
--- a/src/tests/netns.sh
+++ b/src/tests/netns.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
diff --git a/src/tools/wg-quick/linux.bash b/src/tools/wg-quick/linux.bash
index 2f36dee..6a101f3 100755
--- a/src/tools/wg-quick/linux.bash
+++ b/src/tools/wg-quick/linux.bash
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
-- 
2.22.0

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

             reply	other threads:[~2019-07-16 12:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-16 12:21 Jörg Thalheim [this message]
2019-07-16 17:32 ` Jordan Glover
2019-07-16 20:07   ` Janne Johansson
2019-07-16 22:08   ` Jörg Thalheim
2019-07-17 17:32     ` Jordan Glover
2019-07-17 18:39       ` Jörg Thalheim
2019-07-17 18:52         ` Jordan Glover

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ff30a296-bdb9-3b13-5fb1-636a520300c0@higgsboson.tk \
    --to=joerg@higgsboson.tk \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).