From: Vladimir Serbinenko Date: Sun, 22 Jan 2017 17:22:34 +0000 (+0300) Subject: Fix shebang for termux. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3568b5bf8011da2ffc226c1e88f5c6c26fa3225b;p=thirdparty%2Fgrub.git Fix shebang for termux. Termux doesn't have a /bin/sh. So we needto use $SHELL. Keep /bin/sh as much as possible. --- diff --git a/configure.ac b/configure.ac index 29d05c15d..da40cd97d 100644 --- a/configure.ac +++ b/configure.ac @@ -456,6 +456,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 diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in index 045817b15..45d85931e 100644 --- a/grub-core/genmod.sh.in +++ b/grub-core/genmod.sh.in @@ -1,4 +1,4 @@ -#! /bin/sh +#! @BUILD_SHEBANG@ set -e # Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/grub-core/gensyminfo.sh.in b/grub-core/gensyminfo.sh.in index 2e8716b42..9bc767532 100644 --- a/grub-core/gensyminfo.sh.in +++ b/grub-core/gensyminfo.sh.in @@ -1,4 +1,4 @@ -#! /bin/sh +#! @BUILD_SHEBANG@ set -e # Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/grub-core/modinfo.sh.in b/grub-core/modinfo.sh.in index faf0ad30e..f6cd657ce 100644 --- a/grub-core/modinfo.sh.in +++ b/grub-core/modinfo.sh.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!@BUILD_SHEBANG@ # User-controllable options grub_modinfo_target_cpu=@target_cpu@ diff --git a/tests/ahci_test.in b/tests/ahci_test.in index 1d01d1f59..7df560462 100644 --- a/tests/ahci_test.in +++ b/tests/ahci_test.in @@ -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 diff --git a/tests/btrfs_test.in b/tests/btrfs_test.in index c55d9477f..2b37ddd33 100644 --- a/tests/btrfs_test.in +++ b/tests/btrfs_test.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!@BUILD_SHEBANG@ set -e diff --git a/tests/cdboot_test.in b/tests/cdboot_test.in index 1cc901977..75acdfedb 100644 --- a/tests/cdboot_test.in +++ b/tests/cdboot_test.in @@ -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 diff --git a/tests/core_compress_test.in b/tests/core_compress_test.in index 1003587cc..9d216ebcf 100644 --- a/tests/core_compress_test.in +++ b/tests/core_compress_test.in @@ -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 diff --git a/tests/cpio_test.in b/tests/cpio_test.in index 0b09db549..5742cf17b 100644 --- a/tests/cpio_test.in +++ b/tests/cpio_test.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!@BUILD_SHEBANG@ set -e diff --git a/tests/ehci_test.in b/tests/ehci_test.in index 7dd8d3e8f..b197f8cdc 100644 --- a/tests/ehci_test.in +++ b/tests/ehci_test.in @@ -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 diff --git a/tests/example_scripted_test.in b/tests/example_scripted_test.in index 09633e893..783b7f138 100644 --- a/tests/example_scripted_test.in +++ b/tests/example_scripted_test.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!@BUILD_SHEBANG@ set -e true diff --git a/tests/exfat_test.in b/tests/exfat_test.in index fc1a0fe5e..cd3cd4cb2 100644 --- a/tests/exfat_test.in +++ b/tests/exfat_test.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!@BUILD_SHEBANG@ set -e diff --git a/tests/ext234_test.in b/tests/ext234_test.in index c986960a8..892b99cbd 100644 --- a/tests/ext234_test.in +++ b/tests/ext234_test.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!@BUILD_SHEBANG@ set -e diff --git a/tests/fat_test.in b/tests/fat_test.in index 1d132b517..b6b4748ca 100644 --- a/tests/fat_test.in +++ b/tests/fat_test.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!@BUILD_SHEBANG@ set -e diff --git a/tests/fddboot_test.in b/tests/fddboot_test.in index a59645b7f..2d7dfc889 100644 --- a/tests/fddboot_test.in +++ b/tests/fddboot_test.in @@ -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 diff --git a/tests/file_filter_test.in b/tests/file_filter_test.in index 8909e4021..bfb638227 100644 --- a/tests/file_filter_test.in +++ b/tests/file_filter_test.in @@ -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 diff --git a/tests/gettext_strings_test.in b/tests/gettext_strings_test.in index 5c305e75b..813999ebe 100644 --- a/tests/gettext_strings_test.in +++ b/tests/gettext_strings_test.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!@BUILD_SHEBANG@ cd '@srcdir@' diff --git a/tests/grub_script_blanklines.in b/tests/grub_script_blanklines.in index 89ed763d3..bd8735491 100644 --- a/tests/grub_script_blanklines.in +++ b/tests/grub_script_blanklines.in @@ -1,4 +1,4 @@ -#! /bin/sh +#! @BUILD_SHEBANG@ set -e @builddir@/grub-script-check <