From 870fa87c7b8ef199bae5ffac2b1ca4ec95e5744b Mon Sep 17 00:00:00 2001 From: termux-pacman-bot Date: Sat, 3 May 2025 01:34:24 +0000 Subject: [PATCH] Update repo --- scripts/build/termux_step_massage.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/build/termux_step_massage.sh b/scripts/build/termux_step_massage.sh index a9c37638d2..a3762a443d 100644 --- a/scripts/build/termux_step_massage.sh +++ b/scripts/build/termux_step_massage.sh @@ -88,9 +88,10 @@ termux_step_massage() { # However, a package may use the build directory path for dynamically setting the shebang at build time, # so use `PATH_MAX = 4096` as length limit instead, as a shorter limit like `256`/`340` may prevent reading the # entire header line if build directory path is longer and `shebang_regex` will fail to match and skip shebang - # replacement. For example, `pip` from `python-pip` package is set with the following shebang at build time: - #`#!/home/builder/.termux-build/python3.12-crossenv-prefix-bionic-x86_64/cross/bin/python3.12` - read -r -n 4096 header_line < "$file" || continue + # replacement. `4096 + 2` is used as `#!` needs to be read from start of line before the actual path. + # For example, `pip` from `python-pip` package is set with the following shebang at build time: + # `#!/home/builder/.termux-build/python3.12-crossenv-prefix-bionic-x86_64/cross/bin/python3.12` + read -r -n 4098 header_line < "$file" || continue if [[ "${header_line:0:2}" == "#!" && "${#header_line}" -ge 3 && "$header_line" =~ $shebang_regex ]]; then shebang_match="${BASH_REMATCH[0]}" if [[ -n "$shebang_match" ]]; then