Fix shebang for termux.
authorVladimir Serbinenko <phcoder@gmail.com>
Sun, 22 Jan 2017 17:22:34 +0000 (20:22 +0300)
committerVladimir Serbinenko <phcoder@gmail.com>
Wed, 3 May 2017 10:49:31 +0000 (12:49 +0200)
Termux doesn't have a /bin/sh. So we needto use $SHELL.
Keep /bin/sh as much as possible.

60 files changed:
configure.ac
grub-core/genmod.sh.in
grub-core/gensyminfo.sh.in
grub-core/modinfo.sh.in
tests/ahci_test.in
tests/btrfs_test.in
tests/cdboot_test.in
tests/core_compress_test.in
tests/cpio_test.in
tests/ehci_test.in
tests/example_scripted_test.in
tests/exfat_test.in
tests/ext234_test.in
tests/fat_test.in
tests/fddboot_test.in
tests/file_filter_test.in
tests/gettext_strings_test.in
tests/grub_cmd_date.in
tests/grub_cmd_regexp.in
tests/grub_cmd_set_date.in
tests/grub_cmd_sleep.in
tests/grub_cmd_test.in
tests/grub_cmd_tr.in
tests/grub_func_test.in
tests/grub_script_blanklines.in
tests/grub_script_blockarg.in
tests/grub_script_dollar.in
tests/grub_script_expansion.in
tests/grub_script_final_semicolon.in
tests/grub_script_no_commands.in
tests/gzcompress_test.in
tests/hddboot_test.in
tests/help_test.in
tests/hfs_test.in
tests/hfsplus_test.in
tests/iso9660_test.in
tests/jfs_test.in
tests/lzocompress_test.in
tests/minixfs_test.in
tests/netboot_test.in
tests/nilfs2_test.in
tests/ntfs_test.in
tests/ohci_test.in
tests/partmap_test.in
tests/pata_test.in
tests/pseries_test.in
tests/reiserfs_test.in
tests/romfs_test.in
tests/squashfs_test.in
tests/syslinux_test.in
tests/tar_test.in
tests/test_sha512sum.in
tests/udf_test.in
tests/uhci_test.in
tests/util/grub-fs-tester.in
tests/util/grub-shell-tester.in
tests/util/grub-shell.in
tests/xfs_test.in
tests/xzcompress_test.in
tests/zfs_test.in

index e0262e1..ee2c865 100644 (file)
@@ -459,6 +459,16 @@ case "$build_os" in
 esac
 AC_SUBST(BUILD_EXEEXT)
 
+# In some build environments like termux /bin/sh is not a valid
+# shebang. Use $SHELL instead if it's executable and /bin/sh isn't
+BUILD_SHEBANG=/bin/sh
+for she in /bin/sh "$SHELL"; do
+  if test -x "$she" ; then
+    BUILD_SHEBANG="$she"
+  fi
+done
+AC_SUBST(BUILD_SHEBANG)
+
 # For gnulib.
 gl_INIT
 
index 03cc3b7..3de06ee 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 # Copyright (C) 2010 Free Software Foundation, Inc.
index 2e8716b..9bc7675 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 # Copyright (C) 2010 Free Software Foundation, Inc.
index faf0ad3..f6cd657 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 # User-controllable options
 grub_modinfo_target_cpu=@target_cpu@
index 1d01d1f..7df5604 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 # Copyright (C) 2013  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
index c55d947..2b37ddd 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index 1cc9019..75acdfe 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 # Copyright (C) 2013  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
index 1003587..9d216eb 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 # Copyright (C) 2013  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
index 0b09db5..5742cf1 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index 7dd8d3e..b197f8c 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 # Copyright (C) 2013  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
index 09633e8..783b7f1 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 set -e
 
 true
index fc1a0fe..cd3cd4c 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index c986960..892b99c 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index 1d132b5..b6b4748 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index a59645b..2d7dfc8 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 # Copyright (C) 2013  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
index 8909e40..bfb6382 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 # Copyright (C) 2014  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
index 5c305e7..813999e 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 cd '@srcdir@'
 
index 60f039e..f7c9ca0 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 . "@builddir@/grub-core/modinfo.sh"
index 7e9ab86..6520bd6 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 # Run GRUB script in a Qemu instance
index 2f518dd..aac120a 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 . "@builddir@/grub-core/modinfo.sh"
index ac51d42..8797f66 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 . "@builddir@/grub-core/modinfo.sh"
index 49ae8a9..3399eb2 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 
 # create a randome file
 empty="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
index 0e8d645..bed469c 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh -e
+#! @BUILD_SHEBANG@ -e
 
 # Run GRUB script in a Qemu instance
 # Copyright (C) 2010  Free Software Foundation, Inc.
index b32f244..c67f9e4 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 . "@builddir@/grub-core/modinfo.sh"
index 89ed763..bd87354 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 @builddir@/grub-script-check <<EOF
index 63b60a2..6ea9b8c 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 
 # Run GRUB script in a Qemu instance
 # Copyright (C) 2010  Free Software Foundation, Inc.
index 2e07642..392fe2e 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 @builddir@/grub-script-check << EOF
index 2b78295..9d0dcdd 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 # Run GRUB script in a Qemu instance
index 3ac2654..f17a9bf 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 @builddir@/grub-script-check <<EOF
index c31d267..996bb18 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 # grub-script-check refuses to pass a file with no commands; this usually
index 11b6bb2..42c8fe7 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 # Copyright (C) 2013  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
index c229716..6d70847 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 # Copyright (C) 2013  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
index aa96458..b08cf20 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 . "@builddir@/grub-core/modinfo.sh"
index e3e88f1..d7ec56b 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index f947c4a..85f1c37 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index fdcc9e1..571b938 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index c2e5ece..6cf7576 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index 41984c2..4e5f7e0 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 # Copyright (C) 2013  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
index 1784b12..3b16a4d 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index c757023..9f71e3d 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 # Copyright (C) 2013  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
index 780b60e..ad44d5b 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index e25c638..9eb7b01 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index 7fede6f..8693f8c 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 # Copyright (C) 2013  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
index f8dc456..6ef518b 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 # Copyright (C) 2010  Free Software Foundation, Inc.
index c1d0f63..4b18fde 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 # Copyright (C) 2013  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
index 2264945..655eb4f 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 # Copyright (C) 2013  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
index 678efe7..b5fed76 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index 83e0931..98bb50c 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index ec34e01..2f044f9 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index fc4edd8..4ea8639 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index 46ba3bc..6e2f2de 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index 80ebdc5..027092a 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 
 # create a randome file
 file="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
index fe244e2..fb92f01 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index 89e2c18..4af72fd 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 # Copyright (C) 2013  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
index 468d9e7..88cbe73 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index 5adce0a..8a87109 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 # Compares GRUB script output with BASH output.
index 814f36c..d690d67 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 set -e
 
 # Run GRUB script in a Qemu instance
index 3807e2e..03a3513 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e
 
index b2bd999..03bfb5e 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! @BUILD_SHEBANG@
 # Copyright (C) 2013  Free Software Foundation, Inc.
 #
 # GRUB is free software: you can redistribute it and/or modify
index 047120e..eee62c1 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@BUILD_SHEBANG@
 
 set -e