Bug#953389: [Pkg-zsh-devel] Bug#953389: Bug#953389: zsh-common: completion for dscverify is missing
Hi, 09/03/2020 15:04, Daniel Shahaf : > Thanks, v2 looks good. Would you please post it to zsh-work...@zsh.org? > I could just commit it upstream, but I'd like to have a second pair of eyes > over it. I will send the patch now and put you in CC for handling the final details before merge. >> +'*:dsc file:_files -g "*.{changes,dsc}(-.)"' > In this line — > > 1. You may need to change «{foo,bar}» to «(foo|bar)» to avoid NO_MATCH errors > when foo exists but bar doesn't. (Once you do this, you may then need to > change «(-.)» to «(#q-.)».) Tried this change locally, and the completion was not working anymore. Back to the v2 version, when I "rm *.dsc" in a test directory so that only *.changes files are present, I did not get any NO_MATCH error. The completion just went fine on *.changes files. Maybe I am missing something, but this modification is not included in attached v3 patch (version I am sending to zsh-workers). > 2. Add "buildinfo" alongside "changes" and "dsc". Good catch, added in v3 patch. Ciao, Romain. diff -u -N --recursive ../zsh-5.8.orig/Completion/Debian/Command/_dscverify ./Completion/Debian/Command/_dscverify --- ../zsh-5.8.orig/Completion/Debian/Command/_dscverify 1970-01-01 01:00:00.0 +0100 +++ ./Completion/Debian/Command/_dscverify 2020-03-09 15:36:16.206314783 +0100 @@ -0,0 +1,30 @@ +#compdef dscverify + +# $ dscverify --version +# This is dscverify, from the Debian devscripts package, version 2.20.2 +# ... + +_dscverify() { + local all_opts=( +'--help[show the help message and exit]' +'--version[show the version + copyright and exit]' +'--no-default-keyrings[do not check against the default keyrings]' +'*--keyring[add keyring to the list of keyrings used]:keyring:_files -g "*.{kbx,gpg}(-.)"' +'(--nosigcheck --no-sig-check -u)'{--nosigcheck,--no-sig-check,-u}'[do not verify the GPG signature]' +'--verbose[do not suppress GPG output]' +'*:dsc file:_files -g "*.{changes,dsc,buildinfo}(-.)"' + ) + + local first_only=( +'(--no-conf --noconf)'{--no-conf,--noconf}'[do not read the devscripts config file]' + ) + + if (( CURRENT == 2 )); then +all_opts+=($first_only) + fi + + _arguments \ +"$all_opts[@]" +} + +_dscverify "$@" signature.asc Description: OpenPGP digital signature
Bug#953389: [Pkg-zsh-devel] Bug#953389: Bug#953389: zsh-common: completion for dscverify is missing
Control: forwarded -1 workers/45524 Romain Porte wrote on Mon, 09 Mar 2020 14:45 +00:00: > 09/03/2020 15:04, Daniel Shahaf : > >> +'*:dsc file:_files -g "*.{changes,dsc}(-.)"' > > In this line — > > > > 1. You may need to change «{foo,bar}» to «(foo|bar)» to avoid NO_MATCH > > errors > > when foo exists but bar doesn't. (Once you do this, you may then need to > > change «(-.)» to «(#q-.)».) > Tried this change locally, and the completion was not working anymore. > Back to the v2 version, when I "rm *.dsc" in a test directory so that > only *.changes files are present, I did not get any NO_MATCH error. The > completion just went fine on *.changes files. Maybe I am missing > something, but this modification is not included in attached v3 patch > (version I am sending to zsh-workers). +1. I think the reason it works with brace expansion is that compinit sets the NULLGLOB option (in $_comp_options). TIL :-) I'll merge the patch upstream after giving -workers@ a chance to review. Cheers, Daniel
Bug#953389: [Pkg-zsh-devel] Bug#953389: Bug#953389: zsh-common: completion for dscverify is missing
Romain Porte wrote on Mon, Mar 09, 2020 at 10:33:29 +0100: > Hello, > > 09/03/2020 02:51, Daniel Shahaf : > > Thanks. Upstreaming would consist of emailing the patch to > > zsh-work...@zsh.org and updating the metadata on this bug. However, > > have you considered proposing the completion for inclusion in > > devscripts, alongside dscverify(1) and its bash completion? devscripts > > would just need to drop the completion file to > > /usr/share/zsh/vendor-completions/ > > when installing. > > I have found that all the devscripts completion are coming from upstream > directly, as you can check by inspecting the source package. I do not > want to make an exception for dscverify completion to be shipped by > devscripts while all other devscripts completions are coming from upstream. > > This has its pros and cons. I think pro is everyone based on dpkg gets > the completions even without devscripts installed (maybe Ubuntu and > such?) but con is that the completions can get outdated quickly as they > live outside of the devscripts source package. We can see this by the > currently open bugs on zsh-common about outdated devscripts completions. > > A debate can be made, but I think it is outside of the scope of this > contribution. People from devscripts and upstream zsh should be involved > in the discussion. Well said, and I agree. > All done, see attached v2 patch. You proposal for CURRENT == 2 worked > fine, when I pass another option then the --no-conf suggestion > disappears. Multiple keyring option seems possible, because according to > strace each --keyring is performing a fstat(file). > > Thanks for your feedback and have a nice day, Thanks, v2 looks good. Would you please post it to zsh-work...@zsh.org? I could just commit it upstream, but I'd like to have a second pair of eyes over it. > +'*:dsc file:_files -g "*.{changes,dsc}(-.)"' In this line — 1. You may need to change «{foo,bar}» to «(foo|bar)» to avoid NO_MATCH errors when foo exists but bar doesn't. (Once you do this, you may then need to change «(-.)» to «(#q-.)».) 2. Add "buildinfo" alongside "changes" and "dsc". Sorry for not catching these before. Thanks, Daniel