pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/shells/zsh



Module Name:    pkgsrc
Committed By:   wiz
Date:           Sun Nov  6 20:58:00 UTC 2022

Modified Files:
        pkgsrc/shells/zsh: Makefile distinfo
Added Files:
        pkgsrc/shells/zsh/patches: patch-Src_jobs.c

Log Message:
zsh: add candidate upstream patch for bg/fg issue with shell functions

Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 pkgsrc/shells/zsh/Makefile
cvs rdiff -u -r1.78 -r1.79 pkgsrc/shells/zsh/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/shells/zsh/patches/patch-Src_jobs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/shells/zsh/Makefile
diff -u pkgsrc/shells/zsh/Makefile:1.104 pkgsrc/shells/zsh/Makefile:1.105
--- pkgsrc/shells/zsh/Makefile:1.104    Fri Jul  1 23:31:49 2022
+++ pkgsrc/shells/zsh/Makefile  Sun Nov  6 20:58:00 2022
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.104 2022/07/01 23:31:49 rin Exp $
+# $NetBSD: Makefile,v 1.105 2022/11/06 20:58:00 wiz Exp $
 
 DISTNAME=      zsh-5.9
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    shells
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=zsh/}
 EXTRACT_SUFX=  .tar.xz

Index: pkgsrc/shells/zsh/distinfo
diff -u pkgsrc/shells/zsh/distinfo:1.78 pkgsrc/shells/zsh/distinfo:1.79
--- pkgsrc/shells/zsh/distinfo:1.78     Fri Jul  1 23:31:49 2022
+++ pkgsrc/shells/zsh/distinfo  Sun Nov  6 20:58:00 2022
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.78 2022/07/01 23:31:49 rin Exp $
+$NetBSD: distinfo,v 1.79 2022/11/06 20:58:00 wiz Exp $
 
 BLAKE2s (zsh-5.9.tar.xz) = 1ab2ab9dd0debc176bdefd661b62e102153c26f591e35916ccc7527c337d0530
 SHA512 (zsh-5.9.tar.xz) = d9138b7f379ad942a5f46819d2dd52d31f3a1129f2a0d1b53d4c5cd43c318b60396da6d37c57c477b8e958fb750209aca0ae93f8c9dd42ac958de006a0ff067e
@@ -6,4 +6,5 @@ Size (zsh-5.9.tar.xz) = 3332400 bytes
 SHA1 (patch-Completion_BSD_Command___bsd__pkg) = fe0d9cc399fe185ce71a64431e4086ed07920cb8
 SHA1 (patch-Completion_Unix_Command___gpg) = 8eba031838b1cfb0bfadf0fa539e760fd1cb539c
 SHA1 (patch-Config_installfns.sh) = ef0b250a0121c0e4925022e02553aefa23e6cc8d
+SHA1 (patch-Src_jobs.c) = d4be7424283f22a5ce26ba6aebfe51f105c033ce
 SHA1 (patch-configure) = 1b757f0ba6611a206f2e9c4d3de5c11fc629a364

Added files:

Index: pkgsrc/shells/zsh/patches/patch-Src_jobs.c
diff -u /dev/null pkgsrc/shells/zsh/patches/patch-Src_jobs.c:1.1
--- /dev/null   Sun Nov  6 20:58:00 2022
+++ pkgsrc/shells/zsh/patches/patch-Src_jobs.c  Sun Nov  6 20:58:00 2022
@@ -0,0 +1,70 @@
+$NetBSD: patch-Src_jobs.c,v 1.1 2022/11/06 20:58:00 wiz Exp $
+
+Candidate fix for shell function pipeline bg/fg issue, from
+https://zsh.org/mla/workers/2022/msg01204.html
+
+--- Src/jobs.c.orig    2022-05-08 06:18:22.000000000 +0000
++++ Src/jobs.c
+@@ -544,16 +544,14 @@ update_job(Job jn)
+ 
+     if (isset(MONITOR)) {
+       pid_t pgrp = gettygrp();           /* get process group of tty      */
++      int deadpgrp = (mypgrp != pgrp && inforeground && pgrp > 1 &&
++                      kill(-pgrp, 0) == -1 && errno == ESRCH);
+ 
+       /* is this job in the foreground of an interactive shell? */
+       if (mypgrp != pgrp && inforeground &&
+-          (jn->gleader == pgrp ||
+-           (pgrp > 1 &&
+-            (kill(-pgrp, 0) == -1 && errno == ESRCH)))) {
++          ((jn->gleader == pgrp && signalled) || deadpgrp)) {
+           if (list_pipe) {
+-              if (somestopped || (pgrp > 1 &&
+-                                  kill(-pgrp, 0) == -1 &&
+-                                  errno == ESRCH)) {
++              if (somestopped || deadpgrp) {
+                   attachtty(mypgrp);
+                   /* check window size and adjust if necessary */
+                   adjustwinsize(0);
+@@ -566,6 +564,12 @@ update_job(Job jn)
+                    * when the job is finally deleted.
+                    */
+                   jn->stat |= STAT_ATTACH;
++                  /*
++                   * If we're in shell jobs on the right side of a pipeline
++                   * we should treat it like a job in the current shell.
++                   */
++                  if (inforeground == 2)
++                      inforeground = 1;
+               }
+               /* If we have `foo|while true; (( x++ )); done', and hit
+                * ^C, we have to stop the loop, too. */
+@@ -1488,10 +1492,7 @@ addproc(pid_t pid, char *text, int aux, 
+        * set it for that, too.
+        */
+       if (gleader != -1) {
+-          if (jobtab[thisjob].stat & STAT_CURSH)
+-              jobtab[thisjob].gleader = gleader;
+-          else
+-              jobtab[thisjob].gleader = pid;
++          jobtab[thisjob].gleader = gleader;
+           if (list_pipe_job_used != -1)
+               jobtab[list_pipe_job_used].gleader = gleader;
+           /*
+@@ -1500,7 +1501,7 @@ addproc(pid_t pid, char *text, int aux, 
+            */
+           last_attached_pgrp = gleader;
+       } else if (!jobtab[thisjob].gleader)
+-              jobtab[thisjob].gleader = pid;
++          jobtab[thisjob].gleader = pid;
+       /* attach this process to end of process list of current job */
+       pnlist = &jobtab[thisjob].procs;
+     }
+@@ -2488,6 +2489,7 @@ bin_fg(char *name, char **argv, Options 
+               jobtab[job].stat &= ~STAT_CURSH;
+           }
+           if ((stopped = (jobtab[job].stat & STAT_STOPPED))) {
++              /* WIFCONTINUED will makerunning() again at killjb() */
+               makerunning(jobtab + job);
+               if (func == BIN_BG) {
+                   /* Set $! to indicate this was backgrounded */



Home | Main Index | Thread Index | Old Index