1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

build system: modernise shell compatibility checks

All changed files:
- Put the shell in POSIX mode if it has an '-o posix' option.
- Remove nonsense disabling 'set -x' on bash. It's not broken.

bin/package, src/cmd/INIT/package.sh:
- Add check blocking native zsh mode (e.g., "$path" conflicts).
  Using a 'sh -> zsh' symlink works, so recommend that.
- Remove old ksh93 version check for a supposed conflict with
  libcmd. It was broken; it would revert to /bin/sh, but on illumos
  distributions, /bin/sh is a ksh93 of a version that is supposedly
  affected. It builds fine anyway.
- Rewrite checksh() to incorporate the shell compatibility checks
  that were previously in two different places in 'package'.

bin/ignore, src/cmd/INIT/ignore.sh,
bin/silent, src/cmd/INIT/silent.sh:
- Change bad check for a full POSIX 'export' command (no, $RANDOM
  has nothing to do with that) with a proper feature test.
This commit is contained in:
Martijn Dekker 2020-08-23 23:41:31 +01:00
parent 42d1651108
commit 9b45f2ccbe
20 changed files with 113 additions and 128 deletions

View file

@ -34,8 +34,9 @@
# but you shall be confused anyway
#
case $-:$BASH_VERSION in
*x*:[0123456789]*) : bash set -x is broken :; set +ex ;;
case $ZSH_VERSION in
?*) emulate ksh ;;
*) (set -o posix) 2>/dev/null && set -o posix ;;
esac
LC_ALL=C

View file

@ -19,6 +19,12 @@
# Phong Vo <kpv@research.att.com> #
# #
########################################################################
case $ZSH_VERSION in
?*) emulate ksh ;;
*) (set -o posix) 2>/dev/null && set -o posix ;;
esac
ok=0
for i in \
-x /lib/ld.so /lib/ld-*.so /usr/lib/ld.so /lib/rld \

View file

@ -20,6 +20,12 @@
# #
########################################################################
: generate "<sys/param.h> + <sys/types.h> + <sys/stat.h>" include sequence
case $ZSH_VERSION in
?*) emulate ksh ;;
*) (set -o posix) 2>/dev/null && set -o posix ;;
esac
case $# in
0) ;;
*) eval $1

View file

@ -20,6 +20,12 @@
# #
########################################################################
: generate preroot features
case $ZSH_VERSION in
?*) emulate ksh ;;
*) (set -o posix) 2>/dev/null && set -o posix ;;
esac
case $# in
0) ;;
*) eval $1

View file

@ -20,6 +20,12 @@
# #
########################################################################
: generate sig features
case $ZSH_VERSION in
?*) emulate ksh ;;
*) (set -o posix) 2>/dev/null && set -o posix ;;
esac
case $# in
0) ;;
*) eval $1