From 8552f2c7c75a364c4eb0c08fcad6fb3e974b55dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 7 Nov 2026 12:16:04 +0100 Subject: [PATCH 1/3] fix which unknown --- scripts/dev/makedist | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/dev/makedist b/scripts/dev/makedist index 6c8ef3c1dc8a..f8c704580c9f 100755 --- a/scripts/dev/makedist +++ b/scripts/dev/makedist @@ -6,16 +6,13 @@ # Adapted to Git by Stanislav Malyshev . # Check whether gtar is present (GNU tar) -tar="$(which gtar)" -tar="${tar:-$(which tar)}" +tar="$(command -v gtar || command -v tar)" # Handle GNU vs. BSD checksum utilities -md5sum="$(which md5sum)" -md5sum="${md5sum:-$(which md5)}" +md5sum="$(command -v md5sum || command -v md5)" # GNU touch is preferred since it handles local TZ in timestamps -touch="$(which gtouch)" -touch="${touch:-$(which touch)}" +touch="$(command -v gtouch || command -v touch)" if [[ $($tar --version) == *"bsdtar"* ]]; then echo "Found bsdtar at $tar, but this script needs GNU tar." From 2298e89bb3d27590ce584247b9435122fb97d8bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 7 Nov 2026 12:16:23 +0100 Subject: [PATCH 2/3] use "set -ex" in important scripts --- buildconf | 2 ++ scripts/dev/gen_verify_stub | 2 ++ scripts/dev/genfiles | 2 ++ scripts/dev/makedist | 2 ++ 4 files changed, 8 insertions(+) diff --git a/buildconf b/buildconf index 0586cbf0cd27..0cfca21a1b8f 100755 --- a/buildconf +++ b/buildconf @@ -2,6 +2,8 @@ # # A wrapper around Autoconf that generates files to build PHP on *nix systems. +set -ex + PHP_AUTOCONF=${PHP_AUTOCONF:-autoconf} PHP_AUTOHEADER=${PHP_AUTOHEADER:-autoheader} force=0 diff --git a/scripts/dev/gen_verify_stub b/scripts/dev/gen_verify_stub index f9d9cc67ee3e..19c3e576693e 100755 --- a/scripts/dev/gen_verify_stub +++ b/scripts/dev/gen_verify_stub @@ -1,5 +1,7 @@ #!/bin/bash +set -ex + # Handle GNU vs. BSD checksum utilities sha256sum="$(which sha256sum)" sha256sum="${sha256sum:-$(which shasum) -a 256}" diff --git a/scripts/dev/genfiles b/scripts/dev/genfiles index a7068e8c3f81..d8cf561c6903 100755 --- a/scripts/dev/genfiles +++ b/scripts/dev/genfiles @@ -31,6 +31,8 @@ # For example: # YACC=/path/to/bison ./genfiles +set -ex + YACC=${YACC:-bison} YACC="$YACC -l" YFLAGS="-Wall" diff --git a/scripts/dev/makedist b/scripts/dev/makedist index f8c704580c9f..07682fe423e4 100755 --- a/scripts/dev/makedist +++ b/scripts/dev/makedist @@ -5,6 +5,8 @@ # Written by Stig Bakken 1997-05-28. # Adapted to Git by Stanislav Malyshev . +set -ex + # Check whether gtar is present (GNU tar) tar="$(command -v gtar || command -v tar)" From 793b72238d2516b295ae1b471eb379b9c72605cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 7 Nov 2026 12:18:42 +0100 Subject: [PATCH 3/3] exit no longer needed --- buildconf | 4 ++-- scripts/dev/genfiles | 2 +- scripts/dev/makedist | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/buildconf b/buildconf index 0cfca21a1b8f..4c1f8b6a01f1 100755 --- a/buildconf +++ b/buildconf @@ -10,9 +10,9 @@ force=0 debug=0 # Go to project root. -cd "$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)" || exit +cd "$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)" -php_extra_version=$(grep '^AC_INIT(' configure.ac) || exit +php_extra_version=$(grep '^AC_INIT(' configure.ac) case "$php_extra_version" in *-dev*) dev=1 diff --git a/scripts/dev/genfiles b/scripts/dev/genfiles index d8cf561c6903..75c2515c16ff 100755 --- a/scripts/dev/genfiles +++ b/scripts/dev/genfiles @@ -42,7 +42,7 @@ SED=${SED:-sed} MAKE=${MAKE:-make} # Go to project root. -cd "$(CDPATH='' cd -- "$(dirname -- "$0")/../../" && pwd -P)" || exit +cd "$(CDPATH='' cd -- "$(dirname -- "$0")/../../" && pwd -P)" # Check required bison version from the configure.ac file. required_bison_version=$($SED -n 's/PHP_PROG_BISON(\[\([0-9\.]*\)\].*/\1/p' configure.ac) diff --git a/scripts/dev/makedist b/scripts/dev/makedist index 07682fe423e4..105be77aad73 100755 --- a/scripts/dev/makedist +++ b/scripts/dev/makedist @@ -22,7 +22,7 @@ if [[ $($tar --version) == *"bsdtar"* ]]; then fi # Go to project root directory. -cd "$(CDPATH='' cd -- "$(dirname -- "$0")/../../" && pwd -P)" || exit +cd "$(CDPATH='' cd -- "$(dirname -- "$0")/../../" && pwd -P)" # Process options and arguments. while :; do