Initial commit
This commit is contained in:
Executable
+1
@@ -0,0 +1 @@
|
||||
grep -q '/bin/zsh' etc/shells || echo '/bin/zsh' >> etc/shells
|
||||
@@ -0,0 +1 @@
|
||||
sed -i '/^\/bin\/zsh/d' etc/shells
|
||||
@@ -0,0 +1 @@
|
||||
grep -q '/bin/zsh' etc/shells || echo '/bin/zsh' >> etc/shells
|
||||
@@ -0,0 +1 @@
|
||||
emulate sh -c 'source /etc/profile'
|
||||
@@ -0,0 +1,63 @@
|
||||
diff -u a/Src/exec.c b/Src/exec.c
|
||||
--- a/Src/exec.c 2022-05-08 01:18:22.000000000 -0500
|
||||
+++ b/Src/exec.c 2026-02-25 22:23:44.602848997 -0600
|
||||
@@ -4679,7 +4679,34 @@
|
||||
zclose(pipes[1]);
|
||||
retval = readoutput(pipes[0], qt, NULL);
|
||||
fdtable[pipes[0]] = FDT_UNUSED;
|
||||
- waitforpid(pid, 0); /* unblocks */
|
||||
+ wait_for_processes();
|
||||
+ /*
|
||||
+ * The SIGCHLD handler may already have reaped the command
|
||||
+ * substitution child while readoutput() had signals unblocked.
|
||||
+ * In that case cmdoutpid is cleared, and calling waitforpid()
|
||||
+ * on a stale PID can hang if the PID has been reused.
|
||||
+ */
|
||||
+ if (cmdoutpid == pid) {
|
||||
+ int status;
|
||||
+ pid_t waitret;
|
||||
+
|
||||
+ while ((waitret = waitpid(pid, &status, 0)) < 0 && errno == EINTR)
|
||||
+ ;
|
||||
+ if (waitret == pid) {
|
||||
+ cmdoutpid = 0;
|
||||
+ if (WIFSIGNALED(status))
|
||||
+ cmdoutval = (0200 | WTERMSIG(status));
|
||||
+ else
|
||||
+ cmdoutval = WEXITSTATUS(status);
|
||||
+ use_cmdoutval = 1;
|
||||
+ get_usage();
|
||||
+ } else if (waitret < 0 && errno == ECHILD) {
|
||||
+ wait_for_processes();
|
||||
+ if (cmdoutpid == pid)
|
||||
+ cmdoutpid = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ child_unblock();
|
||||
lastval = cmdoutval;
|
||||
return retval;
|
||||
}
|
||||
@@ -4884,7 +4911,22 @@
|
||||
return nam;
|
||||
} else if (pid) {
|
||||
close(fd);
|
||||
- waitforpid(pid, 0);
|
||||
+ wait_for_processes();
|
||||
+ if (cmdoutpid == pid) {
|
||||
+ int status;
|
||||
+ pid_t waitret;
|
||||
+
|
||||
+ while ((waitret = waitpid(pid, &status, 0)) < 0 && errno == EINTR)
|
||||
+ ;
|
||||
+ if (waitret == pid)
|
||||
+ cmdoutpid = 0;
|
||||
+ else if (waitret < 0 && errno == ECHILD) {
|
||||
+ wait_for_processes();
|
||||
+ if (cmdoutpid == pid)
|
||||
+ cmdoutpid = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ child_unblock();
|
||||
cmdoutval = 0;
|
||||
return nam;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
[package]
|
||||
name = "zsh"
|
||||
version = "5.9"
|
||||
revision = 1
|
||||
description = "The Z Shell"
|
||||
homepage = "https://zsh.sourceforge.io/"
|
||||
license = "MIT"
|
||||
|
||||
[[source]]
|
||||
url = "https://sourceforge.net/projects/zsh/files/zsh/$version/zsh-$version.tar.xz"
|
||||
sha256 = "9b8d1ecedd5b5e81fbf1918e876752a7dd948e05c1a0dba10ab863842d45acd5"
|
||||
extract_dir = "$name-$version"
|
||||
patches = [ "zsh-cmdsubst-hang.patch" ]
|
||||
|
||||
[build]
|
||||
type = "autotools"
|
||||
|
||||
[build.flags]
|
||||
configure = [ "--enable-multibyte", "--enable-maildir-support", "--with-term-lib=ncursesw", "--enable-function-subdirs", "--with-tcsetpgrp", "--enable-pcre", "--enable-gdbm", "--enable-cap", "--enable-zsh-secure-free" ]
|
||||
keep = [ "etc/zprofile" ]
|
||||
post_install = [ "install -D -m0644 $DEPOT_SPECDIR/zprofile ${DESTDIR}/etc/zprofile" ]
|
||||
skip_tests = true
|
||||
|
||||
[dependencies]
|
||||
runtime = [ "glibc", "ncurses", "gdbm", "libcap", "pcre2" ]
|
||||
|
||||
[[manual_sources]]
|
||||
files = [ "preinstall.sh", "preremove.sh", "preupdate.sh", "zprofile", "zsh-cmdsubst-hang.patch" ]
|
||||
Reference in New Issue
Block a user