diff options
-rw-r--r-- | ChangeLog | 46 | ||||
-rw-r--r-- | Completion/Unix/Command/_git | 25 | ||||
-rw-r--r-- | Completion/Unix/Command/_subversion | 2 | ||||
-rw-r--r-- | Config/version.mk | 4 | ||||
-rw-r--r-- | Etc/FAQ.yo | 2 | ||||
-rw-r--r-- | Etc/creating-a-release.txt | 3 | ||||
-rw-r--r-- | Makefile.in | 21 | ||||
-rw-r--r-- | NEWS | 11 | ||||
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | Src/builtin.c | 2 | ||||
-rw-r--r-- | Src/exec.c | 37 | ||||
-rw-r--r-- | Src/jobs.c | 14 | ||||
-rw-r--r-- | Src/signals.c | 1 | ||||
-rw-r--r-- | Src/zsh.h | 8 | ||||
-rw-r--r-- | Test/A05execution.ztst | 17 | ||||
-rw-r--r-- | Test/W02jobs.ztst | 70 |
16 files changed, 184 insertions, 84 deletions
@@ -1,5 +1,51 @@ +2018-09-14 Daniel Shahaf <d.s@daniel.shahaf.name> + + * 43457: Config/version.mk, Etc/FAQ.yo, NEWS, README: Release + 5.6.2 + +2018-09-14 Peter Stephenson <p.stephenson@samsung.com> + + * 43466: Test/A05execution.ztst: path(5) test is too specific as + OS codes and messages may vary. + +2018-09-12 Daniel Shahaf <d.s@daniel.shahaf.name> + + * unposted: Completion/Unix/Command/_subversion: _svn: Complete + --accept=recommended, new in 1.10.0. + + * 43447: Etc/creating-a-release.txt, Makefile.in: Generate + tar.xz artifacts only. + + * 43443: Completion/Unix/Command/_git: When completing worktrees, + show the ref and hash of each worktree. + + * 43442: Completion/Unix/Command/_git: Break out a helper + function. + +2018-09-12 Peter Stephenson <p.stephenson@samsung.com> + + * 43450: Src/signals.c: fix window size if reattaching shell + to terminal on exit of process. + + * 43446: Src/exec.c, Src/jobs.c, Src/zsh.h: enhance 43409 to + pass back list_pipe_job as well, fixing additional races. + +2018-09-10 Jörg Thalheim <joerg@thalheim.io> + + * GitHub #28: Src/builtin.c: Add missing math.h include for + builtins + +2018-09-10 Peter Stephenson <p.stephenson@samsung.com> + + * 43426: Test/W02jobs.ztst: disable tests involving suspending + jobs as these are provoking races in particular on OpenSUSE. + 2018-09-08 Daniel Shahaf <d.s@daniel.shahaf.name> + * unposted: Etc/creating-a-release.txt: Add another step. + + * unposted: Config/version.mk: Post-release version bump. + * unposted: Config/version.mk, Etc/FAQ.yo, NEWS, README: Patch release: 5.6.1 diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 2cae4c82f..195a7f6dc 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -2108,8 +2108,7 @@ _git-worktree() { ;; esac if [[ $state = worktrees ]]; then - _wanted directories expl 'working tree' compadd -S ' ' -f -M 'r:|/=* r:|=*' \ - ${${(M)${(f)"$(_call_program directories git worktree list --porcelain)"}:#worktree*}#* } && ret=0 + __git_worktrees && ret=0 fi ;; esac @@ -7561,6 +7560,28 @@ __git_browsers () { 'builtin-browsers:builtin browser:compadd -a - builtinbrowsers' } +__git_worktrees () { + local -a records=( ${(ps.\n\n.)"$(_call_program directories git worktree list --porcelain)"} ) + local -a directories descriptions + local i hash branch + for i in $records; do + directories+=( ${${i%%$'\n'*}#worktree } ) + hash=${${${"${(f)i}"[2]}#HEAD }[1,9]} + branch=${${"${(f)i}"[3]}#branch refs/heads/} + + # Simulate the non-porcelain output + if [[ $branch == detached ]]; then + # TODO: show a ref that points at $hash here, like vcs_info does? + branch="(detached HEAD)" + else + branch="[$branch]" + fi + + descriptions+=( "${directories[-1]}"$'\t'"$hash $branch" ) + done + _wanted directories expl 'working tree' compadd -ld descriptions -S ' ' -f -M 'r:|/=* r:|=*' -a directories +} + (( $+functions[__git_difftools] )) || __git_difftools () { __git_diff-or-merge-tools diff $* diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index e16be7e59..d30f2e657 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -70,7 +70,7 @@ _svn () { ${=${${${(M)${(f)"$(_call_program options svn help $cmd)"#(*Valid options:|(#e))}:#* :*}%% #:*}/ (arg|ARG)/:arg:}/(#b)(-##)([[:alpha:]]##) \[--([a-z-]##)\](:arg:)#/(--$match[3])$match[1]$match[2]$match[4] ($match[1]$match[2])--$match[3]$match[4]} ) while (( idx=$args[(I)*--accept:arg:] )); do - args[idx]=( --accept'=:automatic conflict resolution action:((working\:working base\:base '"`for i j in p postpone mc mine-conflict tc theirs-conflict mf mine-full tf theirs-full e edit l launch; do print -rn $i\\\\:$j $j\\\\:$j ""; done `"'))' ) + args[idx]=( --accept'=:automatic conflict resolution action:((working\:working base\:base recommended\:recommended '"`for i j in p postpone mc mine-conflict tc theirs-conflict mf mine-full tf theirs-full e edit l launch; do print -rn $i\\\\:$j $j\\\\:$j ""; done `"'))' ) done while (( idx=$args[(I)*--c(l|hangelist):arg:] )); do args[idx]=( \*{--cl,--changelist}'=:change list:_svn_changelists' ) diff --git a/Config/version.mk b/Config/version.mk index ee4a0d9b5..33ce37195 100644 --- a/Config/version.mk +++ b/Config/version.mk @@ -27,5 +27,5 @@ # This must also serve as a shell script, so do not add spaces around the # `=' signs. -VERSION=5.6.1 -VERSION_DATE='September 8, 2018' +VERSION=5.6.2 +VERSION_DATE='September 14, 2018' diff --git a/Etc/FAQ.yo b/Etc/FAQ.yo index 10c773b75..a3dfc6c13 100644 --- a/Etc/FAQ.yo +++ b/Etc/FAQ.yo @@ -306,7 +306,7 @@ sect(On what machines will it run?) sect(What's the latest version?) - Zsh 5.6.1 is the latest production version. For details of all the + Zsh 5.6.2 is the latest production version. For details of all the changes, see the NEWS file in the source distribution. A beta of the next version is sometimes available. Development of zsh is diff --git a/Etc/creating-a-release.txt b/Etc/creating-a-release.txt index bb7272368..2445151f5 100644 --- a/Etc/creating-a-release.txt +++ b/Etc/creating-a-release.txt @@ -40,8 +40,6 @@ To create a zsh release: make tarxz-doc tarxz-src for i in zsh*.tar.?z ; do gpg -ab -- $i ; done - # The tarxz-* targets create both *.tar.gz and *.tar.xz. - - [one time step] Add your key to http://zsh.sf.net/Arc/source.html; see README in the 'web' repository for how to do this. Its URL is: git clone git://git.code.sf.net/p/zsh/web @@ -51,6 +49,7 @@ To create a zsh release: Test releases go to the "zsh-test" directory. Stable releases to zsh/ and zsh-doc/. + After uploading, select the tar.xz artifact, press the 🛈 button ("View Details") to its right, and press [Select All] next to "Default Download For:". This should cause sf.net to offer that artifact in the "Looking for the latest version?" line. - Upload to zsh.org diff --git a/Makefile.in b/Makefile.in index 00d74b7f2..d8568294b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -159,28 +159,19 @@ $(sdir)/stamp-h.in: $(sdir)/configure DISTNAME = zsh-$(VERSION) -targz-src: $(DISTNAME).tar.gz -$(DISTNAME).tar.gz: FORCE +tarxz-src: $(DISTNAME).tar.xz +$(DISTNAME).tar.xz: FORCE @$(sdir_top)/Util/mkdisttree.sh $(DISTNAME) $(sdir_top) $(dir_top) SRC \ $(MAKE) $(MAKEDEFS) echo '#define ZSH_PATCHLEVEL "'`cd $(sdir_top) && git describe --tags --long --abbrev=7`'"' >$(DISTNAME)/Src/patchlevel.h.release - tar cf - $(DISTNAME) | gzip -9 > $@ + tar cf - $(DISTNAME) | xz -9 > $@ rm -rf $(DISTNAME) -targz-doc: $(DISTNAME)-doc.tar.gz -$(DISTNAME)-doc.tar.gz: FORCE +tarxz-doc: $(DISTNAME)-doc.tar.xz +$(DISTNAME)-doc.tar.xz: FORCE @$(sdir_top)/Util/mkdisttree.sh $(DISTNAME) $(sdir_top) $(dir_top) DOC \ $(MAKE) $(MAKEDEFS) - tar cf - $(DISTNAME) | gzip -9 > $@ + tar cf - $(DISTNAME) | xz -9 > $@ rm -rf $(DISTNAME) FORCE: - -tarxz-src: $(DISTNAME).tar.xz -$(DISTNAME).tar.xz: $(DISTNAME).tar.gz - < $< zcat | xz -9 > $@ - -tarxz-doc: $(DISTNAME)-doc.tar.xz -$(DISTNAME)-doc.tar.xz: $(DISTNAME)-doc.tar.gz - < $< zcat | xz -9 > $@ - @@ -4,6 +4,17 @@ CHANGES FROM PREVIOUS VERSIONS OF ZSH Note also the list of incompatibilities in the README file. +Changes from 5.6.1 to 5.6.2 +--------------------------- + +Fix another SIGTTOU case. + +Fix SIGWINCH being ignored when zsh is not in the foreground. + +The release tarballs are now compressed using xz(1), whereas previously +both xz(1) and gzip(1) versions were available. If this gets in your way, +give us a shout. + Changes from 5.6 to 5.6.1 ------------------------- @@ -5,8 +5,9 @@ THE Z SHELL (ZSH) Version ------- -This is version 5.6.1 of the shell. This is a bugfix release, following -5.6 which was a security and feature release. +This is version 5.6.2 of the shell. This is a bugfix release, following +5.6 which was a security and feature release and 5.6.1 which was a bugfix +release. Note in particular the changes highlighted under "Incompatibilities since 5.5.1" below. See NEWS for more information. diff --git a/Src/builtin.c b/Src/builtin.c index 93fa9112c..4abc7da35 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -33,6 +33,8 @@ #include "zsh.mdh" #include "builtin.pro" +#include <math.h> + /* Builtins in the main executable */ static struct builtin builtins[] = diff --git a/Src/exec.c b/Src/exec.c index 074265f9f..b9af9ea63 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -1002,7 +1002,7 @@ enum { /**/ static void -entersubsh(int flags, int *gleaderp) +entersubsh(int flags, struct entersubsh_ret *retp) { int i, sig, monitor, job_control_ok; @@ -1036,8 +1036,10 @@ entersubsh(int flags, int *gleaderp) if (!(flags & ESUB_ASYNC)) attachtty(jobtab[thisjob].gleader); } - if (gleaderp) - *gleaderp = jobtab[list_pipe_job].gleader; + if (retp) { + retp->gleader = jobtab[list_pipe_job].gleader; + retp->list_pipe_job = list_pipe_job; + } } else if (!jobtab[thisjob].gleader || setpgrp(0L, jobtab[thisjob].gleader) == -1) { @@ -1058,8 +1060,11 @@ entersubsh(int flags, int *gleaderp) setpgrp(0L, jobtab[thisjob].gleader); if (!(flags & ESUB_ASYNC)) attachtty(jobtab[thisjob].gleader); - if (gleaderp) - *gleaderp = jobtab[thisjob].gleader; + if (retp) { + retp->gleader = jobtab[thisjob].gleader; + if (list_pipe_job != thisjob) + retp->list_pipe_job = list_pipe_job; + } } } if (!(flags & ESUB_FAKE)) @@ -1692,7 +1697,7 @@ execpline(Estate state, wordcode slcode, int how, int last1) curjob = newjob; DPUTS(!list_pipe_pid, "invalid list_pipe_pid"); addproc(list_pipe_pid, list_pipe_text, 0, - &list_pipe_start, -1); + &list_pipe_start, -1, -1); /* If the super-job contains only the sub-shell, the sub-shell is the group leader. */ @@ -2185,7 +2190,7 @@ closemn(struct multio **mfds, int fd, int type) } mn->ct = 1; mn->fds[0] = fd; - addproc(pid, NULL, 1, &bgtime, -1); + addproc(pid, NULL, 1, &bgtime, -1, -1); child_unblock(); return; } @@ -2686,10 +2691,12 @@ execcmd_fork(Estate state, int how, int type, Wordcode varspc, { pid_t pid; int synch[2], flags; - int gleader = -1; + struct entersubsh_ret esret; struct timeval bgtime; child_block(); + esret.gleader = -1; + esret.list_pipe_job = -1; if (pipe(synch) < 0) { zerr("pipe failed: %e", errno); @@ -2703,7 +2710,7 @@ execcmd_fork(Estate state, int how, int type, Wordcode varspc, } if (pid) { close(synch[1]); - read_loop(synch[0], (char *)&gleader, sizeof(gleader)); + read_loop(synch[0], (char *)&esret, sizeof(esret)); close(synch[0]); if (how & Z_ASYNC) { lastpid = (zlong) pid; @@ -2721,7 +2728,7 @@ execcmd_fork(Estate state, int how, int type, Wordcode varspc, 3 : WC_ASSIGN_NUM(ac) + 2); } } - addproc(pid, text, 0, &bgtime, gleader); + addproc(pid, text, 0, &bgtime, esret.gleader, esret.list_pipe_job); if (oautocont >= 0) opts[AUTOCONTINUE] = oautocont; pipecleanfilelist(jobtab[thisjob].filelist, 1); @@ -2736,8 +2743,8 @@ execcmd_fork(Estate state, int how, int type, Wordcode varspc, if (type == WC_SUBSH && !(how & Z_ASYNC)) flags |= ESUB_JOB_CONTROL; *filelistp = jobtab[thisjob].filelist; - entersubsh(flags, &gleader); - write(synch[1], &gleader, sizeof(gleader)); + entersubsh(flags, &esret); + write(synch[1], &esret, sizeof(esret)); close(synch[1]); zclose(close_if_forked); @@ -4876,7 +4883,7 @@ getproc(char *cmd, char **eptr) if (pid == -1) return NULL; if (!out) - addproc(pid, NULL, 1, &bgtime, -1); + addproc(pid, NULL, 1, &bgtime, -1, -1); procsubstpid = pid; return pnam; } @@ -4913,7 +4920,7 @@ getproc(char *cmd, char **eptr) addfilelist(NULL, fd); if (!out) { - addproc(pid, NULL, 1, &bgtime, -1); + addproc(pid, NULL, 1, &bgtime, -1, -1); } procsubstpid = pid; return pnam; @@ -4965,7 +4972,7 @@ getpipe(char *cmd, int nullexec) return -1; } if (!nullexec) - addproc(pid, NULL, 1, &bgtime, -1); + addproc(pid, NULL, 1, &bgtime, -1, -1); procsubstpid = pid; return pipes[!out]; } diff --git a/Src/jobs.c b/Src/jobs.c index ba87a17fa..db2e87ec1 100644 --- a/Src/jobs.c +++ b/Src/jobs.c @@ -1375,7 +1375,8 @@ deletejob(Job jn, int disowning) /**/ void -addproc(pid_t pid, char *text, int aux, struct timeval *bgtime, int gleader) +addproc(pid_t pid, char *text, int aux, struct timeval *bgtime, + int gleader, int list_pipe_job_used) { Process pn, *pnlist; @@ -1397,10 +1398,15 @@ addproc(pid_t pid, char *text, int aux, struct timeval *bgtime, int gleader) * the job, then it's the group leader. * * Exception: if the forked subshell reported its own group - * leader, set that. + * leader, set that. If it reported the use of list_pipe_job, + * set it for that, too. */ - if (!jobtab[thisjob].gleader) - jobtab[thisjob].gleader = (gleader != -1) ? gleader : pid; + if (gleader != -1) { + jobtab[thisjob].gleader = gleader; + if (list_pipe_job_used != -1) + jobtab[list_pipe_job_used].gleader = gleader; + } else if (!jobtab[thisjob].gleader) + jobtab[thisjob].gleader = pid; /* attach this process to end of process list of current job */ pnlist = &jobtab[thisjob].procs; } diff --git a/Src/signals.c b/Src/signals.c index 20c6fdf4a..99aad0fab 100644 --- a/Src/signals.c +++ b/Src/signals.c @@ -550,6 +550,7 @@ wait_for_processes(void) * leader, however. */ attachtty(mypgrp); + adjustwinsize(0); } } } @@ -505,6 +505,14 @@ enum { ZCONTEXT_PARSE = (1<<2) }; +/* Report from entersubsh() to pass subshell info to addproc */ +struct entersubsh_ret { + /* Process group leader chosen by subshell, else -1 */ + int gleader; + /* list_pipe_job setting used by subshell, else -1 */ + int list_pipe_job; +}; + /**************************/ /* Abstract types for zsh */ /**************************/ diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst index 567bd2530..5d3d460df 100644 --- a/Test/A05execution.ztst +++ b/Test/A05execution.ztst @@ -52,12 +52,17 @@ 0:path (4) *>foo */command.tmp/tstcmd-arg - path=($shpath $echopath ${ZTST_testdir}/command.tmp/) - tstcmd-interp-too-long 2>&1; echo "status $?" - path=($storepath) -0:path (5) -*>*tstcmd-interp-too-long: bad interpreter: x*xn: no such file or directory ->status 127 + # Just check this exits with non-zero status, + # as output and status code can differ. + ( + path=($shpath $echopath ${ZTST_testdir}/command.tmp/) + if tstcmd-interp-too-long >/dev/null 2>&1; then + exit 0 + else + exit 1 + fi + ) +1:path (5) functst() { print $# arguments:; print -l $*; } functst "Eines Morgens" "als Gregor Samsa" diff --git a/Test/W02jobs.ztst b/Test/W02jobs.ztst index 1e7ac76c6..fe12f979d 100644 --- a/Test/W02jobs.ztst +++ b/Test/W02jobs.ztst @@ -85,27 +85,29 @@ *>zsh:*running jobs* *>zsh:*SIGHUPed* - zpty_start - zpty_input 'setopt check_jobs no_check_running_jobs' - zpty_input 'sleep 3' - sleep 0.1 - zpty_input $'\C-z' - zpty_stop -0:suspended job with check_jobs + no_check_running_jobs -*>zsh:*(stopped|suspended)*sleep* -*>zsh:*(stopped|suspended) jobs* -# no 'SIGHUPed' message for suspended jobs - - zpty_start - zpty_input 'setopt check_jobs check_running_jobs' - zpty_input 'sleep 3' - sleep 0.1 - zpty_input $'\C-z' - zpty_stop -0:suspended job with check_jobs + check_running_jobs -*>zsh:*(stopped|suspended)*sleep* -*>zsh:*(stopped|suspended) jobs* -# no 'SIGHUPed' message for suspended jobs +#### Races presumed to be associated with zpty mean that +#### tests involving suspending jobs are not safe. +## zpty_start +## zpty_input 'setopt check_jobs no_check_running_jobs' +## zpty_input 'sleep 3' +## sleep 0.1 +## zpty_input $'\C-z' +## zpty_stop +## 0:suspended job with check_jobs + no_check_running_jobs +## *>zsh:*(stopped|suspended)*sleep* +## *>zsh:*(stopped|suspended) jobs* +## # no 'SIGHUPed' message for suspended jobs +## +## zpty_start +## zpty_input 'setopt check_jobs check_running_jobs' +## zpty_input 'sleep 3' +## sleep 0.1 +## zpty_input $'\C-z' +## zpty_stop +## 0:suspended job with check_jobs + check_running_jobs +## *>zsh:*(stopped|suspended)*sleep* +## *>zsh:*(stopped|suspended) jobs* +## # no 'SIGHUPed' message for suspended jobs zpty_start zpty_input 'sleep 5 & sleep 4 & sleep 3 &' @@ -153,19 +155,19 @@ *>- *>zsh:*SIGHUPed* - zpty_start - zpty_input 'sleep 5' - sleep 0.1 - zpty_input $'\C-z' - zpty_input 'jobs -r' - zpty_input 'print -- -' - zpty_input 'jobs -s' - zpty_stop -0:`jobs -r` and `jobs -s` with suspended job -*>zsh:*(stopped|suspended)*sleep* -*>- -*>\[1] + (stopped|suspended)*sleep* -# no 'SIGHUPed' message for suspended jobs +## zpty_start +## zpty_input 'sleep 5' +## sleep 0.1 +## zpty_input $'\C-z' +## zpty_input 'jobs -r' +## zpty_input 'print -- -' +## zpty_input 'jobs -s' +## zpty_stop +## 0:`jobs -r` and `jobs -s` with suspended job +## *>zsh:*(stopped|suspended)*sleep* +## *>- +## *>\[1] + (stopped|suspended)*sleep* +## # no 'SIGHUPed' message for suspended jobs zpty_start zpty_input 'sleep 10 & sleep 9 & sleep 8 & sleep 7 &' |