1
0
mirror of https://git.tukaani.org/xz.git synced 2025-02-22 16:38:11 +00:00

Build: Update posix-shell.m4 from Gnulib

Tabs have been converted to spaces and a "serial" number has been
added. The previous version was from 2008/2009. There are no functional
changes since then but now it's clearer that the copy in XZ Utils
isn't outdated.

The new file was picked from the Gnulib commit
81a4c1e3b7692e95c0806d948cbab9148ad85ef2. A later commit adds
a warranty disclaimer to the license, which obviously is fine,
but I didn't find a SPDX license identifier for the new license,
so for simplicity I used the earlier commit.
This commit is contained in:
Lasse Collin 2025-02-02 14:15:07 +02:00
parent 84c33c0384
commit 23ea031820
No known key found for this signature in database
GPG Key ID: 38EE757D69184620

View File

@ -1,13 +1,14 @@
dnl SPDX-License-Identifier: FSFULLR dnl SPDX-License-Identifier: FSFULLR
# posix-shell.m4
# serial 1
dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Find a POSIX-conforming shell. # Find a POSIX-conforming shell.
# Copyright (C) 2007-2008 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# Written by Paul Eggert. # Written by Paul Eggert.
# If a POSIX-conforming shell can be found, set POSIX_SHELL and # If a POSIX-conforming shell can be found, set POSIX_SHELL and
@ -19,22 +20,22 @@ AC_DEFUN([gl_POSIX_SHELL],
AC_CACHE_CHECK([for a shell that conforms to POSIX], [gl_cv_posix_shell], AC_CACHE_CHECK([for a shell that conforms to POSIX], [gl_cv_posix_shell],
[gl_test_posix_shell_script=' [gl_test_posix_shell_script='
func_return () { func_return () {
(exit [$]1) (exit [$]1)
} }
func_success () { func_success () {
func_return 0 func_return 0
} }
func_failure () { func_failure () {
func_return 1 func_return 1
} }
func_ret_success () { func_ret_success () {
return 0 return 0
} }
func_ret_failure () { func_ret_failure () {
return 1 return 1
} }
subshell_umask_sanity () { subshell_umask_sanity () {
(umask 22; (umask 0); test $(umask) -eq 22) (umask 22; (umask 0); test $(umask) -eq 22)
} }
test "[$](echo foo)" = foo && test "[$](echo foo)" = foo &&
func_success && func_success &&
@ -45,11 +46,11 @@ AC_DEFUN([gl_POSIX_SHELL],
subshell_umask_sanity subshell_umask_sanity
' '
for gl_cv_posix_shell in \ for gl_cv_posix_shell in \
"$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do "$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do
case $gl_cv_posix_shell in case $gl_cv_posix_shell in
/*) /*)
"$gl_cv_posix_shell" -c "$gl_test_posix_shell_script" 2>/dev/null \ "$gl_cv_posix_shell" -c "$gl_test_posix_shell_script" 2>/dev/null \
&& break;; && break;;
esac esac
done]) done])