diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2018-09-11 00:41:19 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2018-09-11 00:41:19 +0200 |
commit | b531f38d5c75078478f2eaa0b714cc08afa6fce2 (patch) | |
tree | c31812913cefe3b80b8c4abcbfa05516091c1628 | |
parent | a04e81b62565a21b0c613115e57f983e7c56d35e (diff) | |
parent | b3239c5e40eea0a73992160c5619b7d191ede490 (diff) | |
download | zsh-b531f38d5c75078478f2eaa0b714cc08afa6fce2.tar.gz zsh-b531f38d5c75078478f2eaa0b714cc08afa6fce2.zip |
Merge tag 'zsh-5.6.1' into debian
Patch release: 5.6.1
-rw-r--r-- | ChangeLog | 45 | ||||
-rw-r--r-- | Completion/Linux/Command/_e2label | 3 | ||||
-rw-r--r-- | Completion/Zsh/Command/_compdef | 5 | ||||
-rw-r--r-- | Config/version.mk | 4 | ||||
-rw-r--r-- | Doc/Makefile.in | 13 | ||||
-rw-r--r-- | Etc/FAQ.yo | 2 | ||||
-rw-r--r-- | Etc/creating-a-release.txt | 62 | ||||
-rw-r--r-- | NEWS | 7 | ||||
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | Src/exec.c | 45 | ||||
-rw-r--r-- | Src/jobs.c | 13 | ||||
-rw-r--r-- | Test/A05execution.ztst | 18 |
12 files changed, 179 insertions, 43 deletions
@@ -1,5 +1,50 @@ +2018-09-08 Daniel Shahaf <d.s@daniel.shahaf.name> + + * unposted: Config/version.mk, Etc/FAQ.yo, NEWS, README: Patch + release: 5.6.1 + +2018-09-07 Peter Stephenson <p.stephenson@samsung.com> + + * 43409: Src/exec.c, Src/jobs.c: ensure main shell and newly + started subshell are agreed on which process group the latter + belongs to. + +2018-09-07 Daniel Shahaf <d.s@daniel.shahaf.name> + + * 43404 (after 43392): Doc/Makefile.in: Fix 'make install' + in out-of-tree builds + +2018-09-06 Daniel Shahaf <d.s@daniel.shahaf.name> + + * 43392: Doc/Makefile.in, Etc/creating-a-release.txt: dist: + Generate doc/help/* and doc/help.txt in builddir rather than + srcdir. + + * 43366: Completion/Zsh/Command/_compdef: Change and add sources + for completed completion function names. + +2018-09-05 dana <dana@dana.is> + + * 43372: Completion/Linux/Command/_e2label: Add completion for + e2label + +2018-09-05 Peter Stephenson <p.stephenson@samsung.com> + + * 43375 with fix from 43390: Test/A05execution.ztst: don't + assume path for sh and echo, work it out. + +2018-09-05 Daniel Shahaf <d.s@daniel.shahaf.name> + + * unposted (cf 43373): Etc/creating-a-release.txt: Add two + caveats: no local modifications, and need to build in-tree. + 2018-09-03 Daniel Shahaf <d.s@daniel.shahaf.name> + * 43370: Etc/creating-a-release.txt: New maintainer-facing + documentation. + + * unposted: Config/version.mk: Post-release version bump. + * unposted: Config/version.mk: Release 5.6. 2018-09-03 Anthony Sottile <asottile@umich.edu> diff --git a/Completion/Linux/Command/_e2label b/Completion/Linux/Command/_e2label new file mode 100644 index 000000000..2545f72af --- /dev/null +++ b/Completion/Linux/Command/_e2label @@ -0,0 +1,3 @@ +#compdef e2label + +_arguments '1:device:_files' '2::volume label:(/dev/disk/by-label/*(N:t))' diff --git a/Completion/Zsh/Command/_compdef b/Completion/Zsh/Command/_compdef index 7a64da835..22af7f561 100644 --- a/Completion/Zsh/Command/_compdef +++ b/Completion/Zsh/Command/_compdef @@ -1,6 +1,6 @@ #compdef compdef -local state line expl list disp curcontext="$curcontext" pat normal ret=1 +local state line expl disp curcontext="$curcontext" pat normal ret=1 local args1 args2 typeset -A opt_args @@ -57,7 +57,8 @@ case $state in _wanted commands expl 'completed command' compadd -k _comps && ret=0 ;; cfun) - list=( ${^fpath:/.}/_(|*[^~])(:t) ) + typeset -aU list=( ${(v)_comps} ${(k)functions[(I)_*]} ) + (( ${+list[1]} )) || list+=( ${^fpath:/.}/_(|*[^~])(:t) ) if zstyle -T ":completion:${curcontext}:functions" prefix-hidden; then disp=( ${list[@]#_} ) _wanted functions expl 'completion function' \ diff --git a/Config/version.mk b/Config/version.mk index 6bd5734bf..ee4a0d9b5 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 -VERSION_DATE='September 3, 2018' +VERSION=5.6.1 +VERSION_DATE='September 8, 2018' diff --git a/Doc/Makefile.in b/Doc/Makefile.in index fded2e825..9dea79252 100644 --- a/Doc/Makefile.in +++ b/Doc/Makefile.in @@ -201,11 +201,10 @@ runhelp: help.txt .PHONY: runhelp help.txt: zshbuiltins.1 - @-rm -f $(sdir)/help.txt $(sdir)/help/* + @-rm -f $@ help/* perl $(sdir_top)/Util/helpfiles \ - $(sdir)/zshbuiltins.1 $(sdir)/help $(sdir)/help.txt \ - || rm -f $(sdir)/help.txt $(sdir)/help/* - touch $(sdir)/$@ + $(sdir)/zshbuiltins.1 help help.txt \ + || rm -f help.txt help/* $(MAN): zmacros.yo zman.yo @@ -338,11 +337,11 @@ install.man: man install.runhelp: $(runhelp) if test x"$(runhelpdir)" != x""; then \ ${SHELL} $(sdir_top)/mkinstalldirs $(DESTDIR)$(runhelpdir); \ - $(INSTALL_DATA) $(sdir)/help/* $(DESTDIR)$(runhelpdir); \ + $(INSTALL_DATA) help/* $(DESTDIR)$(runhelpdir); \ while read from to; do \ rm -f $(DESTDIR)$(runhelpdir)/$$to || : ; \ $(LN_S) $$from $(DESTDIR)$(runhelpdir)/$$to; \ - done < $(sdir)/help.txt; \ + done < help.txt; \ fi .PHONY: install.runhelp @@ -419,7 +418,7 @@ distclean-here: clean-here realclean-here: distclean-here cd $(sdir) && rm -f Zsh/modlist.yo Zsh/modmenu.yo Zsh/manmodmenu.yo cd $(sdir) && rm -f version.yo ../META-FAQ zsh.texi $(MAN) - cd $(sdir) && rm -f help.txt help/* + rm -f help.txt help/* .PHONY: realclean-here @CLEAN_MK@ diff --git a/Etc/FAQ.yo b/Etc/FAQ.yo index d4dc8a150..10c773b75 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 is the latest production version. For details of all the + Zsh 5.6.1 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 new file mode 100644 index 000000000..bb7272368 --- /dev/null +++ b/Etc/creating-a-release.txt @@ -0,0 +1,62 @@ +To create a zsh release: + +- Be satisfied that 'master' is releaseable. + (No recent destabilizing changes, `make check` passes, etc) + +- Bump or update: + + Config/version.mk to today's date + Config/version.mk version number (sequence: 5.4.2, 5.4.2-dev-$((i++)), 5.4.2-test-$((++j)), 5.5) + Etc/FAQ.yo + README + NEWS + +- Commit those changes with an "unposted" ChangeLog entry. + + git commit -am "Test release: 5.5.1-test-1." && + zshdev-add-nnnnn-and-changelog unposted + # (Everyone has a different way of getting the "unposted" magic string + # into ChangeLog and the log message. This script is how I do it; YMMV; + # see Etc/zsh-development-guide for alternative scripts.) + +- Create signed git tag named "zsh-5.5.1-..." (not "5.5.1-...") + + git tag --sign -m "Tag version zsh-5.5.1-test-1." zsh-5.5.1-test-1 + +- If the tagged release is a stable release (as opposed to a test release): + + vi Config/version.mk # bump to 5.6-dev-0 and tomorrow's date + git commit -am "Post-release version bump." && + zshdev-add-nnnnn-and-changelog unposted + # or local equivalent (see above) + +- Create tarball: + + git checkout zsh-5.5.1-test-1 + git diff HEAD # ensure no local mods + Util/preconfig && ./configure ... + make -C Etc + make -C Doc everything + 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 + git clone ssh://git.code.sf.net/p/zsh/web + +- Upload to sf.net + + Test releases go to the "zsh-test" directory. + Stable releases to zsh/ and zsh-doc/. + +- Upload to zsh.org + +- Post to -workers@ + +- After a day or so post to: + + -users@, if test release; + -announce@, if stable release. @@ -4,6 +4,13 @@ CHANGES FROM PREVIOUS VERSIONS OF ZSH Note also the list of incompatibilities in the README file. +Changes from 5.6 to 5.6.1 +------------------------- + +Fix packaging issue that broke runhelp. + +Fix a regression with pipelines getting backgrounded and emitting SIGTTOU. + Changes from 5.5.1-test-2 to 5.6 -------------------------------- @@ -5,9 +5,8 @@ THE Z SHELL (ZSH) Version ------- -This is version 5.6 of the shell. This is a security and feature release. -There are some significant bug fixes and a few user visible additions since -5.5.1. All zsh installations are encouraged to upgrade as soon as possible. +This is version 5.6.1 of the shell. This is a bugfix release, following +5.6 which was a security and feature release. Note in particular the changes highlighted under "Incompatibilities since 5.5.1" below. See NEWS for more information. diff --git a/Src/exec.c b/Src/exec.c index 09ee13209..074265f9f 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -994,9 +994,15 @@ enum { ESUB_JOB_CONTROL = 0x40 }; +/* + * gleaderp may be NULL. Otherwise, *gleaderp is set to point to the + * group leader of the job of the new process if this is assigned. Else + * it is left alone: it is initialised to -1. + */ + /**/ static void -entersubsh(int flags) +entersubsh(int flags, int *gleaderp) { int i, sig, monitor, job_control_ok; @@ -1030,6 +1036,8 @@ entersubsh(int flags) if (!(flags & ESUB_ASYNC)) attachtty(jobtab[thisjob].gleader); } + if (gleaderp) + *gleaderp = jobtab[list_pipe_job].gleader; } else if (!jobtab[thisjob].gleader || setpgrp(0L, jobtab[thisjob].gleader) == -1) { @@ -1050,6 +1058,8 @@ entersubsh(int flags) setpgrp(0L, jobtab[thisjob].gleader); if (!(flags & ESUB_ASYNC)) attachtty(jobtab[thisjob].gleader); + if (gleaderp) + *gleaderp = jobtab[thisjob].gleader; } } if (!(flags & ESUB_FAKE)) @@ -1682,7 +1692,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); + &list_pipe_start, -1); /* If the super-job contains only the sub-shell, the sub-shell is the group leader. */ @@ -1818,7 +1828,7 @@ execpline(Estate state, wordcode slcode, int how, int last1) } else { close(synch[0]); - entersubsh(ESUB_ASYNC); + entersubsh(ESUB_ASYNC, NULL); /* * At this point, we used to attach this process * to the process group of list_pipe_job (the @@ -2175,7 +2185,7 @@ closemn(struct multio **mfds, int fd, int type) } mn->ct = 1; mn->fds[0] = fd; - addproc(pid, NULL, 1, &bgtime); + addproc(pid, NULL, 1, &bgtime, -1); child_unblock(); return; } @@ -2676,7 +2686,7 @@ execcmd_fork(Estate state, int how, int type, Wordcode varspc, { pid_t pid; int synch[2], flags; - char dummy; + int gleader = -1; struct timeval bgtime; child_block(); @@ -2693,7 +2703,7 @@ execcmd_fork(Estate state, int how, int type, Wordcode varspc, } if (pid) { close(synch[1]); - read_loop(synch[0], &dummy, 1); + read_loop(synch[0], (char *)&gleader, sizeof(gleader)); close(synch[0]); if (how & Z_ASYNC) { lastpid = (zlong) pid; @@ -2711,7 +2721,7 @@ execcmd_fork(Estate state, int how, int type, Wordcode varspc, 3 : WC_ASSIGN_NUM(ac) + 2); } } - addproc(pid, text, 0, &bgtime); + addproc(pid, text, 0, &bgtime, gleader); if (oautocont >= 0) opts[AUTOCONTINUE] = oautocont; pipecleanfilelist(jobtab[thisjob].filelist, 1); @@ -2726,7 +2736,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); + entersubsh(flags, &gleader); + write(synch[1], &gleader, sizeof(gleader)); close(synch[1]); zclose(close_if_forked); @@ -3842,7 +3853,7 @@ execcmd_exec(Estate state, Execcmd_params eparams, if ((do_exec || (type >= WC_CURSH && last1 == 1)) && !forked) flags |= ESUB_REVERTPGRP; - entersubsh(flags); + entersubsh(flags, NULL); } if (type == WC_FUNCDEF) { Eprog redir_prog; @@ -4604,7 +4615,7 @@ getoutput(char *cmd, int qt) child_unblock(); zclose(pipes[0]); redup(pipes[1], 1); - entersubsh(ESUB_PGRP|ESUB_NOMONITOR); + entersubsh(ESUB_PGRP|ESUB_NOMONITOR, NULL); cmdpush(CS_CMDSUBST); execode(prog, 0, 1, "cmdsubst"); cmdpop(); @@ -4798,7 +4809,7 @@ getoutputfile(char *cmd, char **eptr) /* pid == 0 */ redup(fd, 1); - entersubsh(ESUB_PGRP|ESUB_NOMONITOR); + entersubsh(ESUB_PGRP|ESUB_NOMONITOR, NULL); cmdpush(CS_CMDSUBST); execode(prog, 0, 1, "equalsubst"); cmdpop(); @@ -4865,7 +4876,7 @@ getproc(char *cmd, char **eptr) if (pid == -1) return NULL; if (!out) - addproc(pid, NULL, 1, &bgtime); + addproc(pid, NULL, 1, &bgtime, -1); procsubstpid = pid; return pnam; } @@ -4875,7 +4886,7 @@ getproc(char *cmd, char **eptr) zerr("can't open %s: %e", pnam, errno); _exit(1); } - entersubsh(ESUB_ASYNC|ESUB_PGRP); + entersubsh(ESUB_ASYNC|ESUB_PGRP, NULL); redup(fd, out); #else /* PATH_DEV_FD */ int pipes[2], fd; @@ -4902,12 +4913,12 @@ getproc(char *cmd, char **eptr) addfilelist(NULL, fd); if (!out) { - addproc(pid, NULL, 1, &bgtime); + addproc(pid, NULL, 1, &bgtime, -1); } procsubstpid = pid; return pnam; } - entersubsh(ESUB_ASYNC|ESUB_PGRP); + entersubsh(ESUB_ASYNC|ESUB_PGRP, NULL); redup(pipes[out], out); closem(FDT_UNUSED, 0); /* this closes pipes[!out] as well */ #endif /* PATH_DEV_FD */ @@ -4954,11 +4965,11 @@ getpipe(char *cmd, int nullexec) return -1; } if (!nullexec) - addproc(pid, NULL, 1, &bgtime); + addproc(pid, NULL, 1, &bgtime, -1); procsubstpid = pid; return pipes[!out]; } - entersubsh(ESUB_PGRP); + entersubsh(ESUB_PGRP, NULL); redup(pipes[out], out); closem(FDT_UNUSED, 0); /* this closes pipes[!out] as well */ cmdpush(CS_CMDSUBST); diff --git a/Src/jobs.c b/Src/jobs.c index 38b3d896b..ba87a17fa 100644 --- a/Src/jobs.c +++ b/Src/jobs.c @@ -1375,7 +1375,7 @@ deletejob(Job jn, int disowning) /**/ void -addproc(pid_t pid, char *text, int aux, struct timeval *bgtime) +addproc(pid_t pid, char *text, int aux, struct timeval *bgtime, int gleader) { Process pn, *pnlist; @@ -1392,10 +1392,15 @@ addproc(pid_t pid, char *text, int aux, struct timeval *bgtime) if (!aux) { pn->bgtime = *bgtime; - /* if this is the first process we are adding to * - * the job, then it's the group leader. */ + /* + * if this is the first process we are adding to + * the job, then it's the group leader. + * + * Exception: if the forked subshell reported its own group + * leader, set that. + */ if (!jobtab[thisjob].gleader) - jobtab[thisjob].gleader = pid; + jobtab[thisjob].gleader = (gleader != -1) ? gleader : pid; /* attach this process to end of process list of current job */ pnlist = &jobtab[thisjob].procs; } diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst index fb39d0589..567bd2530 100644 --- a/Test/A05execution.ztst +++ b/Test/A05execution.ztst @@ -6,16 +6,20 @@ cd command.tmp - print '#!/bin/sh\necho This is top' >tstcmd + shcmd="$(which sh)" + shpath=${shcmd:h} + echocmd="$(which -p echo)" + echopath=${echocmd:h} + print "#!${shcmd}\necho This is top" >tstcmd - print '#!/bin/sh\necho This is dir1' >dir1/tstcmd + print "#!${shcmd}\necho This is dir1" >dir1/tstcmd - print '#!/bin/sh\necho This is dir2' >dir2/tstcmd + print "#!${shcmd}\necho This is dir2" >dir2/tstcmd print -n '#!sh\necho This is slashless' >tstcmd-slashless print -n '#!echo foo\necho This is arg' >tstcmd-arg print '#!xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxnyyy' >tstcmd-interp-too-long - print '#!/bin/sh\necho should not execute; exit 1' >xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxn + print "#!${sh}\necho should not execute; exit 1" >xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxn chmod 755 tstcmd dir1/tstcmd dir2/tstcmd chmod 755 tstcmd-slashless tstcmd-arg tstcmd-interp-too-long @@ -40,15 +44,15 @@ 0:path (2) >This is top - PATH=/bin:${ZTST_testdir}/command.tmp/ tstcmd-slashless + PATH=${shpath}:${ZTST_testdir}/command.tmp/ tstcmd-slashless 0:path (3) >This is slashless - PATH=/bin:${ZTST_testdir}/command.tmp tstcmd-arg + PATH=${echopath}:${ZTST_testdir}/command.tmp tstcmd-arg 0:path (4) *>foo */command.tmp/tstcmd-arg - path=(/bin ${ZTST_testdir}/command.tmp/) + path=($shpath $echopath ${ZTST_testdir}/command.tmp/) tstcmd-interp-too-long 2>&1; echo "status $?" path=($storepath) 0:path (5) |