--- a/src/main/script.c 2026-10-14 12:41:34.690665764 +0800 +++ b/src/main/script.c 2026-10-14 12:41:34.690708349 +0800 @@ -47,6 +47,8 @@ #include "main.h" +#include + void post_postinst_tasks(struct pkginfo *pkg, enum pkgstatus new_status) { @@ -230,6 +232,11 @@ command_add_arg(&cmd, scriptname); command_add_argv(&cmd, args); + /* Termux packages ship maintainer scripts whose interpreter line names + * the Termux prefix; on Android that path belongs to another + * application and the kernel refuses to exec it. Point it at us. */ + doubao_fix_script_shebang(scriptpath); + if (stat(scriptpath, &stab)) { command_destroy(&cmd); @@ -306,6 +313,11 @@ command_add_argv(&cmd, args); va_end(args); + /* Termux packages ship maintainer scripts whose interpreter line names + * the Termux prefix; on Android that path belongs to another + * application and the kernel refuses to exec it. Point it at us. */ + doubao_fix_script_shebang(cidir); + if (stat(cidir, &stab)) { command_destroy(&cmd); @@ -347,6 +359,11 @@ versiondescribe(&pkg->available.version, vdew_nonambig), NULL); + /* Termux packages ship maintainer scripts whose interpreter line names + * the Termux prefix; on Android that path belongs to another + * application and the kernel refuses to exec it. Point it at us. */ + doubao_fix_script_shebang(oldscriptpath); + if (stat(oldscriptpath, &stab)) { if (errno == ENOENT) { debug(dbg_scripts, @@ -377,6 +394,11 @@ versiondescribe(&pkg->available.version, vdew_nonambig), NULL); + /* Termux packages ship maintainer scripts whose interpreter line names + * the Termux prefix; on Android that path belongs to another + * application and the kernel refuses to exec it. Point it at us. */ + doubao_fix_script_shebang(cidir); + if (stat(cidir, &stab)) { command_destroy(&cmd);