From: Joel Borggrén-Franck <jbf@codehouse.se>
Date: Wed, 1 Dec 2010 20:27:52 +0000 (+0100)
Subject: test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portability
X-Git-Tag: debian/0.6_254~106
X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=3fa843216c918fe4a6151e55947cf3a7f46fcdb5;p=notmuch

test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portability

Change #!/bin/bash at start of tests to "#!/usr/bin/env bash". That way
systems running on bash < 4 can prepend bash >= 4 to path before
running the tests.
---

diff --git a/test/README b/test/README
index ebaa3cfd..07da480b 100644
--- a/test/README
+++ b/test/README
@@ -68,11 +68,11 @@ remaining tests to be unaffected.
 
 Writing Tests
 -------------
-The test script is written as a shell script.  It should start
-with the standard "#!/bin/bash" with copyright notices, and an
+The test script is written as a shell script.  It should start with
+the standard "#!/usr/bin/env bash" with copyright notices, and an
 assignment to variable 'test_description', like this:
 
-	#!/bin/bash
+	#!/usr/bin/env bash
 	#
 	# Copyright (c) 2005 Junio C Hamano
 	#
diff --git a/test/aggregate-results.sh b/test/aggregate-results.sh
index 0f1ea332..732d6ca7 100755
--- a/test/aggregate-results.sh
+++ b/test/aggregate-results.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
 
 fixed=0
 success=0
diff --git a/test/author-order b/test/author-order
index d1149922..6ffeffc7 100755
--- a/test/author-order
+++ b/test/author-order
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 test_description="author reordering;"
 . ./test-lib.sh
 
diff --git a/test/basic b/test/basic
index 13e02258..a8d1f1d2 100755
--- a/test/basic
+++ b/test/basic
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Copyright (c) 2005 Junio C Hamano
 #
diff --git a/test/dump-restore b/test/dump-restore
index 0d78f014..a4de3706 100755
--- a/test/dump-restore
+++ b/test/dump-restore
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 test_description="\"notmuch dump\" and \"notmuch restore\""
 . ./test-lib.sh
 
diff --git a/test/emacs b/test/emacs
index e2dfa9ab..bfa054fc 100755
--- a/test/emacs
+++ b/test/emacs
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 test_description="emacs interface"
 . test-lib.sh
 
diff --git a/test/encoding b/test/encoding
index 68cb8ee8..673b0394 100755
--- a/test/encoding
+++ b/test/encoding
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 test_description="encoding issues"
 . ./test-lib.sh
 
diff --git a/test/from-guessing b/test/from-guessing
index 6744e687..d8727bbf 100755
--- a/test/from-guessing
+++ b/test/from-guessing
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 test_description="From line heuristics (with multiple configured addresses)"
 . ./test-lib.sh
 
diff --git a/test/json b/test/json
index 307cd1e6..7c818563 100755
--- a/test/json
+++ b/test/json
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 test_description="--format=json output"
 . ./test-lib.sh
 
diff --git a/test/long-id b/test/long-id
index 84f92943..85e620fa 100755
--- a/test/long-id
+++ b/test/long-id
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 test_description="messages with ridiculously-long message IDs"
 . ./test-lib.sh
 
diff --git a/test/maildir-sync b/test/maildir-sync
index 50a5b8e6..2b43127e 100755
--- a/test/maildir-sync
+++ b/test/maildir-sync
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 test_description="maildir synchronization"
 
diff --git a/test/new b/test/new
index 7b396ae4..1b7296e8 100755
--- a/test/new
+++ b/test/new
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 test_description='"notmuch new" in several variations'
 . ./test-lib.sh
 
diff --git a/test/notmuch-test b/test/notmuch-test
index 0ea4f4f7..c81e3fc0 100755
--- a/test/notmuch-test
+++ b/test/notmuch-test
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 # Run tests
 #
diff --git a/test/raw b/test/raw
index 4ed237c1..b7e265a8 100755
--- a/test/raw
+++ b/test/raw
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr//bin/env bash
 
 test_description='notmuch show --format=raw'
 . ./test-lib.sh
diff --git a/test/reply b/test/reply
index 99c33760..c0b8e261 100755
--- a/test/reply
+++ b/test/reply
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 test_description="\"notmuch reply\" in several variations"
 . ./test-lib.sh
 
diff --git a/test/search b/test/search
index b180c7ff..2085fe66 100755
--- a/test/search
+++ b/test/search
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 test_description='"notmuch search" in several variations'
 . ./test-lib.sh
 
diff --git a/test/search-output b/test/search-output
index b4149931..ef870bf7 100755
--- a/test/search-output
+++ b/test/search-output
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 test_description='various settings for "notmuch search --output="'
 . ./test-lib.sh
 
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 533d15b5..7fed29cc 100755
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Copyright (c) 2005 Junio C Hamano
 #
diff --git a/test/test-verbose b/test/test-verbose
index f29a9c7d..4100c051 100755
--- a/test/test-verbose
+++ b/test/test-verbose
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 test_description='the verbosity options of the test framework itself.'
 
diff --git a/test/thread-naming b/test/thread-naming
index bcc3d610..41b97d9c 100755
--- a/test/thread-naming
+++ b/test/thread-naming
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 test_description="naming of threads with changing subject"
 . ./test-lib.sh
 
diff --git a/test/thread-order b/test/thread-order
index 1819fce3..6c3a4b3f 100755
--- a/test/thread-order
+++ b/test/thread-order
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 test_description="threading when messages received out of order"
 . ./test-lib.sh
 
diff --git a/test/uuencode b/test/uuencode
index d5093209..d0d16bdd 100755
--- a/test/uuencode
+++ b/test/uuencode
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 test_description="handling of uuencoded data"
 . ./test-lib.sh
 
diff --git a/test/valgrind/valgrind.sh b/test/valgrind/valgrind.sh
index 3bc90f5c..78700c07 100755
--- a/test/valgrind/valgrind.sh
+++ b/test/valgrind/valgrind.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
 
 base=$(basename "$0")