From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=DKIM_ADSP_ALL, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id a6c8bd78 for ; Tue, 10 Dec 2019 10:21:22 +0000 (UTC) Received: (qmail 4164 invoked by alias); 10 Dec 2019 10:21:14 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45000 Received: (qmail 13187 invoked by uid 1010); 10 Dec 2019 10:21:14 -0000 X-Qmail-Scanner-Diagnostics: from lyra.cilg.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25656. spamassassin: 3.4.2. Clear:RC:0(163.172.223.75):SA:0(-4.3/5.0):. Processed in 19.063479 secs); 10 Dec 2019 10:21:14 -0000 X-Envelope-From: lyknode@cilg.org X-Qmail-Scanner-Mime-Attachments: |signature.asc| X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at cilg.org designates 163.172.223.75 as permitted sender) From: Baptiste BEAUPLAT Cc: zsh-workers@zsh.org References: <68254402-c6c6-2579-1675-df637ee1127a@cilg.org> <20190823044039.sk2uiatlvacpcifl@tarpaulin.shahaf.local2> Autocrypt: addr=lyknode@cilg.org; keydata= mDMEWYVzgxYJKwYBBAHaRw8BAQdAn1+Mo/C4jAlV3mrzsp1nOy5HjgDNyPX7wiFugWfjXla0 JEJhcHRpc3RlIEJFQVVQTEFUIDxseWtub2RlQGNpbGcub3JnPoiSBBMWCgA6AhsDAh4BAheA AhkBAgsJAhUKBBYCAwEWIQTrMJH4NHEe9DJXKyAe26o8aSavkgUCXEygBQUJBomTggAKCRAe 26o8aSavkmXsAP9PiRjMyZtIX3Pklp6YICQpkQgwjeNLz04iigTRsvtUxQD/ZLGJsGRzZVE0 kEseV+6jN4l/b0r2uNpYLmAh3ihNDQy4OARZhXODEgorBgEEAZdVAQUBAQdAPh5DRpzsKpTh lKj/7cqHlWaoObjEaEC7MK36ttb0bUEDAQgHiH4EGBYKACYCGwwWIQTrMJH4NHEe9DJXKyAe 26o8aSavkgUCXEygDwUJBomTjAAKCRAe26o8aSavkmyYAQC1pEHddMhdM5Fsx4Q06yJJcjq2 fj1i2vcCBIKyEFSvIwD+K89A/W7dJ4hCzhLZyCoxG+M9uLg+0vC0v1jcD8Rj9QC4MwRZhXWf FgkrBgEEAdpHDwEBB0AFzwV2y5CE0udUp+dvzFLdG+6ILUqP2xEpXdo6QAbJFIj1BBgWCgAm AhsCFiEE6zCR+DRxHvQyVysgHtuqPGkmr5IFAlxMoA8FCQaJkXAAgXYgBBkWCgAdFiEELeJI lTE8XafwieFOF0lLEHld1zMFAlmFdZ8ACgkQF0lLEHld1zOxFwD/U7oY/eL04B3NJmdZiLzh 6Q+Z/p7rwobs6/Wt8Yoan/EA/jgOeBCt/IhBlOIBQCi7EfHY4QquhsFXqz0fZOAnw9MJCRAe 26o8aSavkrq9AP4uvfYO4EJcNII+VmMrQMU3uAmxJcC3RQQqrFj9DXid6AD+OWqT3QoC89oj JVuUOJm9/R5BuqrqIs5oKprJhLaZ6w0= To: Daniel Shahaf Subject: Re: [PATCH] Completion for sbuild Message-ID: <583f56f7-9d85-faf9-61f9-e07b6b40e07c@cilg.org> Date: Tue, 10 Dec 2019 11:20:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20190823044039.sk2uiatlvacpcifl@tarpaulin.shahaf.local2> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="oGW01JHuEuJgWTlytu555iBjhMGi1aRqO" --oGW01JHuEuJgWTlytu555iBjhMGi1aRqO Content-Type: multipart/mixed; boundary="X589XP9M2b7A6w7NBcgT7qwHePYQ2heYJ"; protected-headers="v1" From: Baptiste BEAUPLAT To: Daniel Shahaf Cc: zsh-workers@zsh.org Message-ID: <583f56f7-9d85-faf9-61f9-e07b6b40e07c@cilg.org> Subject: Re: [PATCH] Completion for sbuild References: <68254402-c6c6-2579-1675-df637ee1127a@cilg.org> <20190823044039.sk2uiatlvacpcifl@tarpaulin.shahaf.local2> In-Reply-To: <20190823044039.sk2uiatlvacpcifl@tarpaulin.shahaf.local2> --X589XP9M2b7A6w7NBcgT7qwHePYQ2heYJ Content-Type: multipart/mixed; boundary="------------7ABB3856B6BB1CDD0CFC8C35" Content-Language: en-US This is a multi-part message in MIME format. --------------7ABB3856B6BB1CDD0CFC8C35 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Daniel, On 8/23/19 6:40 AM, Daniel Shahaf wrote: > Baptiste BEAUPLAT wrote on Thu, Aug 22, 2019 at 21:53:14 +0200: >> Don't hesitate to give me feedback, I'd be glade to improve it. >=20 > I've done a partial review and found some minor issues. I also have > some suggested additions; those are nice to haves, not blockers, of > course. First of all, let me apologize for the overdue response. I got somewhat overwhelm by the technicality of certain aspect of zsh's completion syste= m. Thanks a lot for taking the time to review this patch, that greatly appreciated. I'll try to fix as much as I can do. >> _deb_distributions() { >=20 > There's already Completion/Debian/Type/_deb_codenames. Please use it > (and improve it if needed). Fixed. I've added unstable to that list. >> _get_identity() { >> [ -n "${DEBFULLNAME}" -a -n "${DEBEMAIL}" ] && \ >> compadd "$@" "${DEBFULLNAME} <${DEBEMAIL}>" >=20 > Please add an end-of-options guard: > . > compadd "$@" -- =E2=80=A6 > . > Please also fix the other instances of this issue in the patch. Fixed. > Please use =C2=AB_wanted=C2=BB to allow filtering by tags. >=20 > I know it's annoying, but it's allowed to do: > . > unset DEBFULLNAME > DEBEMAIL=3D"J Random " > . > Could you support this? Fixed. Although, I did not use _wanted due to a lack of understanding of how it worked. > Please use =C2=AB[[=C2=BB instead of =C2=AB[=C2=BB: the former is a res= erved word, the > latter a builtin. (No effect in this case, but more for a consistent > coding style.) Fixed. >> } >> >> _get_gpg_key() { >> compadd "$@" $(gpg -K --with-colons 2> /dev/null | grep '^uid:u:' = | >> grep -o -e '<[^>]*>' | tr -d '<>') >=20 > Example output: >=20 > [[[ > % GNUPGHOME=3D$PWD gpg -K --with-colons > sec:u:3072:1:A1EA95DE874DB2D5:1566533599:1629605599::u:::scESC:::+:::: > fpr:::::::::D1ADEF874C12D90BFB1062E0A1EA95DE874DB2D5: > grp:::::::::835F9949A6E28D3B70696867F064CBFF5DEBF50B: > uid:u::::1566533599::A06E327EA7388C18E4740E350ED4E60F2E04FC41::foobar: > ssb:u:3072:1:7CF9BDFD879FC134:1566533599:1629605599:::::e:::+::: > fpr:::::::::876684635455EB5CC21751587CF9BDFD879FC134: > grp:::::::::CD7D8D5F91E21EE5ADA28CADF7A17233F028C1FC: > ]]] >=20 > A couple of issues here: >=20 > - Please use _call_program, to make the path to gpg configurable by > zstyle. >=20 > - It would be nice to use builtins and parameter expansions instead of > greps, for performance on Cygwin. (Yes, I know this completion is > for sbuild, but someone might do =C2=ABssh foo sbuild =C2=BB.) = For > example: >=20 > local -a lines=3D( ${(f)"$(_call_program =E2=80=A6)"} ) > lines=3D( ${(M)lines:#(#s)uid:u:*} >=20 > and then split each element by colons to get the right field. (You > need to do that anyway for two reasons: (1)=C2=A0because the uid line= > needn't contain angle brackets; (2)=C2=A0for forwards compatibility w= ith > future versions of gpg.) > =20 > By the way, consider using _describe. If you use the "Name > (Comment)" as the completion, you can add the keyid as the > description, and vice-versa. Fixed. I didn't used _describe as the email address is pretty self describing IMHO. >=20 >> } >> >> _sbuild() { >> '--add-depends=3D[add dependencies to source package]:depends'= \ >=20 > The part after the colon should say something like "source package > name" or "source package names, comma separated". It's actually > displayed during completion if you have the =C2=ABformat=C2=BB style se= t (e.g., > =C2=ABzstyle ':completion:*:(messages|descriptions)' format '> Completi= ng %d=C2=BB). I switched to 'packages' as that's what the expected value is. > I ran out of time here so haven't reviewed the rest of this function, > sorry. >=20 >> '*:dsc file:_files -g "*.dsc"' >> } >> >> _sbuild "$@" Thanks again! Beside your comments, I also: - renamed the internal functions to use _sbuild as a prefix in order to avoid name collision. - re-indended the file to 2 space to match with existing completions file= s. I'll try my best to be more reactive to the next comments. Best, --=20 Baptiste BEAUPLAT - lyknode --------------7ABB3856B6BB1CDD0CFC8C35 Content-Type: text/x-diff; charset=UTF-8; name="0001-_sbuild-safe-use-of-compadd.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-_sbuild-safe-use-of-compadd.patch" =46rom 990037ad0bce3e8fbf9e3a59aff845caec0602e8 Mon Sep 17 00:00:00 2001 From: Baptiste BEAUPLAT Date: Fri, 23 Aug 2019 09:06:03 +0200 Subject: [PATCH 1/7] _sbuild: safe use of compadd --- Completion/Debian/Command/_sbuild | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Completion/Debian/Command/_sbuild b/Completion/Debian/Comman= d/_sbuild index 86a4e60b6..401c6e244 100644 --- a/Completion/Debian/Command/_sbuild +++ b/Completion/Debian/Command/_sbuild @@ -12,17 +12,17 @@ _deb_distributions() { cut -d ',' -f 3)) fi =20 - compadd "$@" "${suite[@]}" unstable experimental + compadd "$@" -- "${suite[@]}" unstable experimental } =20 _get_identity() { [ -n "${DEBFULLNAME}" -a -n "${DEBEMAIL}" ] && \ - compadd "$@" "${DEBFULLNAME} <${DEBEMAIL}>" + compadd "$@" -- "${DEBFULLNAME} <${DEBEMAIL}>" } =20 _get_gpg_key() { - compadd "$@" $(gpg -K --with-colons 2> /dev/null | grep '^uid:u:' | - grep -o -e '<[^>]*>' | tr -d '<>') + compadd "$@" -- $(gpg -K --with-colons 2> /dev/null | grep '^uid:u:'= | + grep -o -e '<[^>]*>' | tr -d '<>') } =20 _sbuild() { --=20 2.24.0 --------------7ABB3856B6BB1CDD0CFC8C35 Content-Type: text/x-diff; charset=UTF-8; name="0002-_sbuild-support-DEBEMAIL-on-its-own.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0002-_sbuild-support-DEBEMAIL-on-its-own.patch" =46rom 142f4c4d73f76f45c4c95933a6f6fcacceaa6db7 Mon Sep 17 00:00:00 2001 From: Baptiste BEAUPLAT Date: Fri, 23 Aug 2019 09:12:55 +0200 Subject: [PATCH 2/7] _sbuild: support DEBEMAIL on its own --- Completion/Debian/Command/_sbuild | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Completion/Debian/Command/_sbuild b/Completion/Debian/Comman= d/_sbuild index 401c6e244..0296c7a94 100644 --- a/Completion/Debian/Command/_sbuild +++ b/Completion/Debian/Command/_sbuild @@ -16,8 +16,17 @@ _deb_distributions() { } =20 _get_identity() { - [ -n "${DEBFULLNAME}" -a -n "${DEBEMAIL}" ] && \ - compadd "$@" -- "${DEBFULLNAME} <${DEBEMAIL}>" + local identity + + if [[ -n "${DEBEMAIL}" ]]; then + if [[ -n "${DEBFULLNAME}" ]]; then + identity =3D "${DEBFULLNAME} <${DEBEMAIL}>" + else + identity =3D "${DEBEMAIL}" + fi + + compadd "$@" -- "${identity}" + fi } =20 _get_gpg_key() { --=20 2.24.0 --------------7ABB3856B6BB1CDD0CFC8C35 Content-Type: text/x-diff; charset=UTF-8; name="0003-Use-parameter-subtitution-to-get-email-from-gpg-uid.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0003-Use-parameter-subtitution-to-get-email-from-gpg-uid.pat"; filename*1="ch" =46rom f268d3be445fa0ffe68b2b1edb58946dad3d4493 Mon Sep 17 00:00:00 2001 From: Baptiste BEAUPLAT Date: Fri, 23 Aug 2019 19:36:26 +0200 Subject: [PATCH 3/7] Use parameter subtitution to get email from gpg uid --- Completion/Debian/Command/_sbuild | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Completion/Debian/Command/_sbuild b/Completion/Debian/Comman= d/_sbuild index 0296c7a94..5796ed827 100644 --- a/Completion/Debian/Command/_sbuild +++ b/Completion/Debian/Command/_sbuild @@ -30,8 +30,16 @@ _get_identity() { } =20 _get_gpg_key() { - compadd "$@" -- $(gpg -K --with-colons 2> /dev/null | grep '^uid:u:'= | - grep -o -e '<[^>]*>' | tr -d '<>') + local -a lines uids + local line + + lines=3D(${(M)${(f)"$(_call_program gpg gpg -K --with-colons 2> /dev= /null)"}:#uid:u*}) + + for line in "${lines[@]}"; do + uids+=3D("${${(s.:.)line}[5][(ws:<:)2,(ws:>:)1]}") + done + + compadd "$@" -- "${uids[@]}" } =20 _sbuild() { --=20 2.24.0 --------------7ABB3856B6BB1CDD0CFC8C35 Content-Type: text/x-diff; charset=UTF-8; name="0004-Use-_deb_codenames-to-fetch-distribution-list-in-_sb.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0004-Use-_deb_codenames-to-fetch-distribution-list-in-_sb.pa"; filename*1="tch" =46rom 910e531c71c2a57504f0c1dc0113d8ae13cee7c5 Mon Sep 17 00:00:00 2001 From: Baptiste BEAUPLAT Date: Tue, 10 Dec 2019 10:39:39 +0100 Subject: [PATCH 4/7] Use _deb_codenames to fetch distribution list in _sb= uild --- Completion/Debian/Command/_sbuild | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Completion/Debian/Command/_sbuild b/Completion/Debian/Comman= d/_sbuild index 5796ed827..469fe5336 100644 --- a/Completion/Debian/Command/_sbuild +++ b/Completion/Debian/Command/_sbuild @@ -1,18 +1,8 @@ #compdef sbuild =20 _deb_distributions() { - local suite stable - suite=3D"" - - # Get stable, oldstable and oldoldstable - if [ -f /usr/share/distro-info/debian.csv ]; then - stable=3D"$(grep -E '^[^,]*(,[^,]*){4}$' /usr/share/distro-info/= debian.csv | - tail -n 1 | cut -d ',' -f 3)" - suite=3D($(grep -B 2 -F ",${stable}," /usr/share/distro-info/deb= ian.csv | - cut -d ',' -f 3)) - fi - - compadd "$@" -- "${suite[@]}" unstable experimental + _deb_codenames + compadd "$@" -- unstable } =20 _get_identity() { --=20 2.24.0 --------------7ABB3856B6BB1CDD0CFC8C35 Content-Type: text/x-diff; charset=UTF-8; name="0005-Reindent-_sbuild-with-2-spaces.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0005-Reindent-_sbuild-with-2-spaces.patch" =46rom 1d552d2b860545337b0bd8e5cfe254acbd756a82 Mon Sep 17 00:00:00 2001 From: Baptiste BEAUPLAT Date: Tue, 10 Dec 2019 10:45:25 +0100 Subject: [PATCH 5/7] Reindent _sbuild with 2 spaces --- Completion/Debian/Command/_sbuild | 243 +++++++++++++++--------------- 1 file changed, 121 insertions(+), 122 deletions(-) diff --git a/Completion/Debian/Command/_sbuild b/Completion/Debian/Comman= d/_sbuild index 469fe5336..23a88e907 100644 --- a/Completion/Debian/Command/_sbuild +++ b/Completion/Debian/Command/_sbuild @@ -1,141 +1,140 @@ #compdef sbuild =20 _deb_distributions() { - _deb_codenames - compadd "$@" -- unstable + _deb_codenames + compadd "$@" -- unstable } =20 _get_identity() { - local identity + local identity =20 - if [[ -n "${DEBEMAIL}" ]]; then - if [[ -n "${DEBFULLNAME}" ]]; then - identity =3D "${DEBFULLNAME} <${DEBEMAIL}>" - else - identity =3D "${DEBEMAIL}" - fi - - compadd "$@" -- "${identity}" + if [[ -n "${DEBEMAIL}" ]]; then + if [[ -n "${DEBFULLNAME}" ]]; then + identity =3D "${DEBFULLNAME} <${DEBEMAIL}>" + else + identity =3D "${DEBEMAIL}" fi + compadd "$@" -- "${identity}" + fi } =20 _get_gpg_key() { - local -a lines uids - local line + local -a lines uids + local line =20 - lines=3D(${(M)${(f)"$(_call_program gpg gpg -K --with-colons 2> /dev= /null)"}:#uid:u*}) + lines=3D(${(M)${(f)"$(_call_program gpg gpg -K --with-colons 2> /dev/n= ull)"}:#uid:u*}) =20 - for line in "${lines[@]}"; do - uids+=3D("${${(s.:.)line}[5][(ws:<:)2,(ws:>:)1]}") - done + for line in "${lines[@]}"; do + uids+=3D("${${(s.:.)line}[5][(ws:<:)2,(ws:>:)1]}") + done =20 - compadd "$@" -- "${uids[@]}" + compadd "$@" -- "${uids[@]}" } =20 _sbuild() { - _arguments \ - '(-h --help)'{-h,--help}'[show help message]' \ - '(-V --version)'{-V,--version}'[show version information]' \ - '(-D --debug)'{-D,--debug}'[enable debug output]' \ - '--add-depends=3D[add dependencies to source package]:depends' \= - '--add-conflicts=3D[add conflicts to source package]:conflicts' = \ - '--add-depends-arch=3D[add arch dependencies to source package]:= depends' \ - '--add-conflicts-arch=3D[add arch conflicts to source package]:c= onflicts' \ - '--add-depends-indep=3D[add indep dependencies to source package= ]:depends' \ - '--add-conflicts-indep=3D[add indep conflicts to source package]= :conflicts' \ - '--arch=3D[architecture]:architecture:_deb_architectures' \ - '--host=3D[host architecture]:architecture:_deb_architectures' \= - '--build=3D[build architecture]:architecture:_deb_architectures'= \ - '(-A --arch-all --no-arch-all)'{-A,--arch-all}'[build Architectu= re: all packages]' \ - '(-A --arch-all --no-arch-all)--no-arch-all[do not build Archite= cture: all packages]' \ - '(--arch-any --no-arch-any)--arch-any[build Architecture: any pa= ckages]' \ - '(--arch-any --no-arch-any)--no-arch-any[do not build Architectu= re: any packages]' \ - '(-b --batch)'{-b,--batch}'[operate in batchmode]' \ - '(-c --chroot)'{-c=3D,--chroot=3D}'[chroot to use]:chroot' \ - '(--chroot-mode)--chroot-mode=3D[chroot mode]:mode:(schroot sudo= autopkgtest unshare)' \ - '(-d --dist)'{-d=3D,--dist=3D}'[distribution]:distribution:_deb_= distributions' \ - '--archive=3D[use specified archive]' \ - '(--apt-clean --no-apt-clean)--apt-clean[force apt-get clean]' \= - '(--apt-clean --no-apt-clean)--no-apt-clean[do not apt-get clean= ]' \ - '(--apt-upgrade --no-apt-upgrade)--apt-upgrade[force apt-get upg= rade]' \ - '(--apt-upgrade --no-apt-upgrade)--no-apt-upgrade[do not apt-get= upgrade]' \ - '(--apt-distupgrade --no-apt-distupgrade)--apt-distupgrade[force= apt-get distupgrade]' \ - '(--apt-distupgrade --no-apt-distupgrade)--no-apt-distupgrade[do= not apt-get distupgrade]' \ - '(-m --maintainer)'{-m=3D,--maintainer=3D}'[Maintainer field for= .changes]:maintainer:_get_identity' \ - '(-e --uploader)'{-e=3D,--uploader=3D}'[Uploader field for .chan= ges]:uploader:_get_identity' \ - '(-k --keyid)'{-k=3D,--keyid=3D}'[GPG Key to sign packages]:gpg = key:_get_gpg_key' \ - '(-j --jobs)'{-j=3D,--jobs=3D}'[jobs to run simultaneously]:numb= er of jobs' \ - '--debbuildopt=3D[option to dpkg-buildpackage]:option' \ - '--debbuildopts=3D[options to dpkg-buildpackage]:options' \ - '--dpkg-source-opt=3D[option to dpkg-source]:option' \ - '--dpkg-source-opts=3D[options to dpkg-source]:options' \ - '--mail-log-to=3D[send log to mail]:recipient:_email_addresses -= c' \ - '--mailfrom=3D[mail from]:sender:_email_addresses -c' \ - '(-n --nolog)'{-n,--nolog}'[no build log file]' \ - '--profiles=3D[profiles for dpkg-buildpackage]:profile list (com= ma separated)' \ - '(-p --purge)'{-p=3D,--purge=3D}'[purge mode]:purge mode:(never = successful always)' \ - '--purge-build=3D[build purge mode]:purge mode:(never successful= always)' \ - '--purge-deps=3D[deps purge mode]:purge mode:(never successful a= lways)' \ - '--purge-session=3D[session purge mode]:purge mode:(never succes= sful always)' \ - '(-s --source --no-source)'{-s,--source}'[build source package]'= \ - '(-s --source --no-source)--no-source[do not build source packag= e]' \ - '--force-orig-source[force orig.tar.gz in .changes]' \ - '--use-snapshot[use latest gcc snapshot]' \ - '(-v --verbose)'{-v,--verbose}'[be verbose]' \ - '(-q --quiet)'{-q,--quiet}'[be quiet]' \ - '--make-binNMU=3D[create binNMU with changelog entry]:changelog = entry' \ - '--binNMU=3D[binNMU version]:version' \ - '--append-to-version=3D[append string to version]:string' \ - '--binNMU-timestamp=3D[binNMU timestamp]:timestamp' \ - '--binNMU-changelog=3D[use this file as binNMU changelog]:file:_= files' \ - '--build-dir=3D[build directory]:directory:_files -/' \ - '(--clean-source --no-clean-source)--clean-source[clean inside a= n unpacked source tree]' \ - '(--clean-source --no-clean-source)--no-clean-source[do not clea= n inside an unpacked source tree]' \ - '(--run-lintian --no-run-lintian)--run-lintian[run lintian]' \ - '(--run-lintian --no-run-lintian)--no-run-lintian[do not run lin= tian]' \ - '(--no-run-lintian --lintian-opt)--lintian-opt=3D[option for lin= tian]:option' \ - '(--no-run-lintian --lintian-opts)--lintian-opts=3D[options for = lintian]:options' \ - '(--run-piuparts --no-run-piuparts)--run-piuparts[run piuparts]'= \ - '(--run-piuparts --no-run-piuparts)--no-run-piuparts[do not run = piuparts]' \ - '(--no-run-piuparts --piuparts-opt)--piuparts-opt=3D[option for = piuparts]:option' \ - '(--no-run-piuparts --piuparts-opts)--piuparts-opts=3D[options f= or piuparts]:options' \ - '(--no-run-piuparts --piuparts-root-arg)--piuparts-root-arg=3D[r= oot-argion for piuparts]:argument' \ - '(--no-run-piuparts --piuparts-root-args)--piuparts-root-args=3D= [root-argions for piuparts]:arguments' \ - '(--run-autopkgtest --no-run-autopkgtest)--run-autopkgtest[run a= utopkgtest]' \ - '(--run-autopkgtest --no-run-autopkgtest)--no-run-autopkgtest[do= not run autopkgtest]' \ - '(--no-run-autopkgtest --autopkgtest-opt)--autopkgtest-opt=3D[op= tion for autopkgtest]:option' \ - '(--no-run-autopkgtest --autopkgtest-opts)--autopkgtest-opts=3D[= options for autopkgtest]:options' \ - '(--no-run-autopkgtest --autopkgtest-root-arg)--autopkgtest-root= -arg=3D[root-argion for autopkgtest]:argument' \ - '(--no-run-autopkgtest --autopkgtest-root-args)--autopkgtest-roo= t-args=3D[root-argions for autopkgtest]:arguments' \ - '--pre-build-commands=3D[run commands before starting anything]:= commands' \ - '--chroot-setup-commands=3D[run commands after chroot initializa= tion]:commands' \ - '--chroot-update-failed-commands=3D[run commands after chroot up= date fails]:commands' \ - '--build-deps-failed-commands=3D[run commands after installing b= uild deps fails]:commands' \ - '--starting-build-commands=3D[run commands after dependencies ar= e installed]:commands' \ - '--finished-build-commands=3D[run commands after package is buil= t]:commands' \ - '--build-failed-commands=3D[run commands after dpkg-buildpackage= fails]:commands' \ - '--chroot-cleanup-commands=3D[run commands after chroot cleanup]= :commands' \ - '--post-build-commands=3D[run commands after package is build su= cessfuly]:commands' \ - '--post-build-failed-commands[run commands after package failed = to build]:commands' \ - '--anything-failed-commands=3D[run commands for all --xxx-failed= -commands option]:commands' \ - '--log-external-command-output[external commands output are logg= ed]' \ - '--log-external-command-error[external commands error output are= logged]' \ - '--build-dep-resolver=3D[resolver for build dependency]:resolver= :(apt aptitude aspcud xapt null)' \ - '--aspcud-criteria=3D[Optimization for aspcud]:criteria' \ - '(--resolve-alternatives --no-resolve-alternatives)--resolve-alt= ernatives[allow alternatives in Build-Depends*]' \ - '(--resolve-alternatives --no-resolve-alternatives)--no-resolve-= alternatives[disallow alternatives in Build-Depends*]' \ - '--extra-package=3D[make a package or directory available to the= resolver]:package:_files -g "*deb' \ - '--extra-repository=3D[add a repository to the resolver]:url' \ - '--extra-repository-key=3D[add key to the resolver]:key:_files -= g "*.asc"' \ - '--build-path=3D[place to build the package inside chroot]:path:= _files -/' \ - '--autopkgtest-virt-server=3D[autopkgtest virtualization server]= :type:(schroot lxc chroot qemu ssh)' \ - '--autopkgtest-virt-server-opt=3D[option for autopkgtest virtial= ization server]:option' \ - '--autopkgtest-virt-server-opts=3D[options for autopkgtest virti= alization server]:options' \ - '--sbuild-mode=3D[switch to buildd mode]:mode:(user buildd)' \ - '--stats-dir=3D[write stats to directory]:path:_files -/' \ - '--purge-extra-packages[remove all but strictly required depende= ncies (experimental)]' \ - '--bd-uninstallable-explainer=3D[choose the method to explain wh= y dependencies failed]:method:(dose3 apt)' \ - '*:dsc file:_files -g "*.dsc"' -} + _arguments \ + '(-h --help)'{-h,--help}'[show help message]' \ + '(-V --version)'{-V,--version}'[show version information]' \ + '(-D --debug)'{-D,--debug}'[enable debug output]' \ + '--add-depends=3D[add dependencies to source package]:depends' \ + '--add-conflicts=3D[add conflicts to source package]:conflicts' \ + '--add-depends-arch=3D[add arch dependencies to source package]:depe= nds' \ + '--add-conflicts-arch=3D[add arch conflicts to source package]:confl= icts' \ + '--add-depends-indep=3D[add indep dependencies to source package]:de= pends' \ + '--add-conflicts-indep=3D[add indep conflicts to source package]:con= flicts' \ + '--arch=3D[architecture]:architecture:_deb_architectures' \ + '--host=3D[host architecture]:architecture:_deb_architectures' \ + '--build=3D[build architecture]:architecture:_deb_architectures' \ + '(-A --arch-all --no-arch-all)'{-A,--arch-all}'[build Architecture: = all packages]' \ + '(-A --arch-all --no-arch-all)--no-arch-all[do not build Architectur= e: all packages]' \ + '(--arch-any --no-arch-any)--arch-any[build Architecture: any packag= es]' \ + '(--arch-any --no-arch-any)--no-arch-any[do not build Architecture: = any packages]' \ + '(-b --batch)'{-b,--batch}'[operate in batchmode]' \ + '(-c --chroot)'{-c=3D,--chroot=3D}'[chroot to use]:chroot' \ + '(--chroot-mode)--chroot-mode=3D[chroot mode]:mode:(schroot sudo aut= opkgtest unshare)' \ + '(-d --dist)'{-d=3D,--dist=3D}'[distribution]:distribution:_deb_dist= ributions' \ + '--archive=3D[use specified archive]' \ + '(--apt-clean --no-apt-clean)--apt-clean[force apt-get clean]' \ + '(--apt-clean --no-apt-clean)--no-apt-clean[do not apt-get clean]' \= + '(--apt-upgrade --no-apt-upgrade)--apt-upgrade[force apt-get upgrade= ]' \ + '(--apt-upgrade --no-apt-upgrade)--no-apt-upgrade[do not apt-get upg= rade]' \ + '(--apt-distupgrade --no-apt-distupgrade)--apt-distupgrade[force apt= -get distupgrade]' \ + '(--apt-distupgrade --no-apt-distupgrade)--no-apt-distupgrade[do not= apt-get distupgrade]' \ + '(-m --maintainer)'{-m=3D,--maintainer=3D}'[Maintainer field for .ch= anges]:maintainer:_get_identity' \ + '(-e --uploader)'{-e=3D,--uploader=3D}'[Uploader field for .changes]= :uploader:_get_identity' \ + '(-k --keyid)'{-k=3D,--keyid=3D}'[GPG Key to sign packages]:gpg key:= _get_gpg_key' \ + '(-j --jobs)'{-j=3D,--jobs=3D}'[jobs to run simultaneously]:number o= f jobs' \ + '--debbuildopt=3D[option to dpkg-buildpackage]:option' \ + '--debbuildopts=3D[options to dpkg-buildpackage]:options' \ + '--dpkg-source-opt=3D[option to dpkg-source]:option' \ + '--dpkg-source-opts=3D[options to dpkg-source]:options' \ + '--mail-log-to=3D[send log to mail]:recipient:_email_addresses -c' \= + '--mailfrom=3D[mail from]:sender:_email_addresses -c' \ + '(-n --nolog)'{-n,--nolog}'[no build log file]' \ + '--profiles=3D[profiles for dpkg-buildpackage]:profile list (comma s= eparated)' \ + '(-p --purge)'{-p=3D,--purge=3D}'[purge mode]:purge mode:(never succ= essful always)' \ + '--purge-build=3D[build purge mode]:purge mode:(never successful alw= ays)' \ + '--purge-deps=3D[deps purge mode]:purge mode:(never successful alway= s)' \ + '--purge-session=3D[session purge mode]:purge mode:(never successful= always)' \ + '(-s --source --no-source)'{-s,--source}'[build source package]' \ + '(-s --source --no-source)--no-source[do not build source package]' = \ + '--force-orig-source[force orig.tar.gz in .changes]' \ + '--use-snapshot[use latest gcc snapshot]' \ + '(-v --verbose)'{-v,--verbose}'[be verbose]' \ + '(-q --quiet)'{-q,--quiet}'[be quiet]' \ + '--make-binNMU=3D[create binNMU with changelog entry]:changelog entr= y' \ + '--binNMU=3D[binNMU version]:version' \ + '--append-to-version=3D[append string to version]:string' \ + '--binNMU-timestamp=3D[binNMU timestamp]:timestamp' \ + '--binNMU-changelog=3D[use this file as binNMU changelog]:file:_file= s' \ + '--build-dir=3D[build directory]:directory:_files -/' \ + '(--clean-source --no-clean-source)--clean-source[clean inside an un= packed source tree]' \ + '(--clean-source --no-clean-source)--no-clean-source[do not clean in= side an unpacked source tree]' \ + '(--run-lintian --no-run-lintian)--run-lintian[run lintian]' \ + '(--run-lintian --no-run-lintian)--no-run-lintian[do not run lintian= ]' \ + '(--no-run-lintian --lintian-opt)--lintian-opt=3D[option for lintian= ]:option' \ + '(--no-run-lintian --lintian-opts)--lintian-opts=3D[options for lint= ian]:options' \ + '(--run-piuparts --no-run-piuparts)--run-piuparts[run piuparts]' \ + '(--run-piuparts --no-run-piuparts)--no-run-piuparts[do not run piup= arts]' \ + '(--no-run-piuparts --piuparts-opt)--piuparts-opt=3D[option for piup= arts]:option' \ + '(--no-run-piuparts --piuparts-opts)--piuparts-opts=3D[options for p= iuparts]:options' \ + '(--no-run-piuparts --piuparts-root-arg)--piuparts-root-arg=3D[root-= argion for piuparts]:argument' \ + '(--no-run-piuparts --piuparts-root-args)--piuparts-root-args=3D[roo= t-argions for piuparts]:arguments' \ + '(--run-autopkgtest --no-run-autopkgtest)--run-autopkgtest[run autop= kgtest]' \ + '(--run-autopkgtest --no-run-autopkgtest)--no-run-autopkgtest[do not= run autopkgtest]' \ + '(--no-run-autopkgtest --autopkgtest-opt)--autopkgtest-opt=3D[option= for autopkgtest]:option' \ + '(--no-run-autopkgtest --autopkgtest-opts)--autopkgtest-opts=3D[opti= ons for autopkgtest]:options' \ + '(--no-run-autopkgtest --autopkgtest-root-arg)--autopkgtest-root-arg= =3D[root-argion for autopkgtest]:argument' \ + '(--no-run-autopkgtest --autopkgtest-root-args)--autopkgtest-root-ar= gs=3D[root-argions for autopkgtest]:arguments' \ + '--pre-build-commands=3D[run commands before starting anything]:comm= ands' \ + '--chroot-setup-commands=3D[run commands after chroot initialization= ]:commands' \ + '--chroot-update-failed-commands=3D[run commands after chroot update= fails]:commands' \ + '--build-deps-failed-commands=3D[run commands after installing build= deps fails]:commands' \ + '--starting-build-commands=3D[run commands after dependencies are in= stalled]:commands' \ + '--finished-build-commands=3D[run commands after package is built]:c= ommands' \ + '--build-failed-commands=3D[run commands after dpkg-buildpackage fai= ls]:commands' \ + '--chroot-cleanup-commands=3D[run commands after chroot cleanup]:com= mands' \ + '--post-build-commands=3D[run commands after package is build sucess= fuly]:commands' \ + '--post-build-failed-commands[run commands after package failed to b= uild]:commands' \ + '--anything-failed-commands=3D[run commands for all --xxx-failed-com= mands option]:commands' \ + '--log-external-command-output[external commands output are logged]'= \ + '--log-external-command-error[external commands error output are log= ged]' \ + '--build-dep-resolver=3D[resolver for build dependency]:resolver:(ap= t aptitude aspcud xapt null)' \ + '--aspcud-criteria=3D[Optimization for aspcud]:criteria' \ + '(--resolve-alternatives --no-resolve-alternatives)--resolve-alterna= tives[allow alternatives in Build-Depends*]' \ + '(--resolve-alternatives --no-resolve-alternatives)--no-resolve-alte= rnatives[disallow alternatives in Build-Depends*]' \ + '--extra-package=3D[make a package or directory available to the res= olver]:package:_files -g "*deb' \ + '--extra-repository=3D[add a repository to the resolver]:url' \ + '--extra-repository-key=3D[add key to the resolver]:key:_files -g "*= =2Easc"' \ + '--build-path=3D[place to build the package inside chroot]:path:_fil= es -/' \ + '--autopkgtest-virt-server=3D[autopkgtest virtualization server]:typ= e:(schroot lxc chroot qemu ssh)' \ + '--autopkgtest-virt-server-opt=3D[option for autopkgtest virtializat= ion server]:option' \ + '--autopkgtest-virt-server-opts=3D[options for autopkgtest virtializ= ation server]:options' \ + '--sbuild-mode=3D[switch to buildd mode]:mode:(user buildd)' \ + '--stats-dir=3D[write stats to directory]:path:_files -/' \ + '--purge-extra-packages[remove all but strictly required dependencie= s (experimental)]' \ + '--bd-uninstallable-explainer=3D[choose the method to explain why de= pendencies failed]:method:(dose3 apt)' \ + '*:dsc file:_files -g "*.dsc"' + } =20 _sbuild "$@" --=20 2.24.0 --------------7ABB3856B6BB1CDD0CFC8C35 Content-Type: text/x-diff; charset=UTF-8; name="0006-Rename-_sbuild-internal-functions-to-avoid-overlap.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0006-Rename-_sbuild-internal-functions-to-avoid-overlap.patc"; filename*1="h" =46rom 134bb906da20344e15b5d7935751e8e9f2d82f57 Mon Sep 17 00:00:00 2001 From: Baptiste BEAUPLAT Date: Tue, 10 Dec 2019 10:50:03 +0100 Subject: [PATCH 6/7] Rename _sbuild internal functions to avoid overlap --- Completion/Debian/Command/_sbuild | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Completion/Debian/Command/_sbuild b/Completion/Debian/Comman= d/_sbuild index 23a88e907..cc1df0f4c 100644 --- a/Completion/Debian/Command/_sbuild +++ b/Completion/Debian/Command/_sbuild @@ -1,11 +1,11 @@ #compdef sbuild =20 -_deb_distributions() { +_sbuild_distributions() { _deb_codenames compadd "$@" -- unstable } =20 -_get_identity() { +_deb_identity() { local identity =20 if [[ -n "${DEBEMAIL}" ]]; then @@ -18,7 +18,7 @@ _get_identity() { fi } =20 -_get_gpg_key() { +_sbuild_signing_key() { local -a lines uids local line =20 @@ -52,7 +52,7 @@ _sbuild() { '(-b --batch)'{-b,--batch}'[operate in batchmode]' \ '(-c --chroot)'{-c=3D,--chroot=3D}'[chroot to use]:chroot' \ '(--chroot-mode)--chroot-mode=3D[chroot mode]:mode:(schroot sudo aut= opkgtest unshare)' \ - '(-d --dist)'{-d=3D,--dist=3D}'[distribution]:distribution:_deb_dist= ributions' \ + '(-d --dist)'{-d=3D,--dist=3D}'[distribution]:distribution:_sbuild_d= istributions' \ '--archive=3D[use specified archive]' \ '(--apt-clean --no-apt-clean)--apt-clean[force apt-get clean]' \ '(--apt-clean --no-apt-clean)--no-apt-clean[do not apt-get clean]' \= @@ -60,9 +60,9 @@ _sbuild() { '(--apt-upgrade --no-apt-upgrade)--no-apt-upgrade[do not apt-get upg= rade]' \ '(--apt-distupgrade --no-apt-distupgrade)--apt-distupgrade[force apt= -get distupgrade]' \ '(--apt-distupgrade --no-apt-distupgrade)--no-apt-distupgrade[do not= apt-get distupgrade]' \ - '(-m --maintainer)'{-m=3D,--maintainer=3D}'[Maintainer field for .ch= anges]:maintainer:_get_identity' \ - '(-e --uploader)'{-e=3D,--uploader=3D}'[Uploader field for .changes]= :uploader:_get_identity' \ - '(-k --keyid)'{-k=3D,--keyid=3D}'[GPG Key to sign packages]:gpg key:= _get_gpg_key' \ + '(-m --maintainer)'{-m=3D,--maintainer=3D}'[Maintainer field for .ch= anges]:maintainer:_deb_identity' \ + '(-e --uploader)'{-e=3D,--uploader=3D}'[Uploader field for .changes]= :uploader:_deb_identity' \ + '(-k --keyid)'{-k=3D,--keyid=3D}'[GPG Key to sign packages]:gpg key:= _sbuild_signing_key' \ '(-j --jobs)'{-j=3D,--jobs=3D}'[jobs to run simultaneously]:number o= f jobs' \ '--debbuildopt=3D[option to dpkg-buildpackage]:option' \ '--debbuildopts=3D[options to dpkg-buildpackage]:options' \ --=20 2.24.0 --------------7ABB3856B6BB1CDD0CFC8C35 Content-Type: text/x-diff; charset=UTF-8; name="0007-Make-message-completion-more-accurate-for-_sbuild.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0007-Make-message-completion-more-accurate-for-_sbuild.patch" =46rom e4702dcf213de6cd2306d7ef7e30f2d55eb5bc29 Mon Sep 17 00:00:00 2001 From: Baptiste BEAUPLAT Date: Tue, 10 Dec 2019 11:02:56 +0100 Subject: [PATCH 7/7] Make message completion more accurate for _sbuild --- Completion/Debian/Command/_sbuild | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Completion/Debian/Command/_sbuild b/Completion/Debian/Comman= d/_sbuild index cc1df0f4c..05f97ef14 100644 --- a/Completion/Debian/Command/_sbuild +++ b/Completion/Debian/Command/_sbuild @@ -36,12 +36,12 @@ _sbuild() { '(-h --help)'{-h,--help}'[show help message]' \ '(-V --version)'{-V,--version}'[show version information]' \ '(-D --debug)'{-D,--debug}'[enable debug output]' \ - '--add-depends=3D[add dependencies to source package]:depends' \ - '--add-conflicts=3D[add conflicts to source package]:conflicts' \ - '--add-depends-arch=3D[add arch dependencies to source package]:depe= nds' \ - '--add-conflicts-arch=3D[add arch conflicts to source package]:confl= icts' \ - '--add-depends-indep=3D[add indep dependencies to source package]:de= pends' \ - '--add-conflicts-indep=3D[add indep conflicts to source package]:con= flicts' \ + '--add-depends=3D[add dependencies to source package]:packages' \ + '--add-conflicts=3D[add conflicts to source package]:packages' \ + '--add-depends-arch=3D[add arch dependencies to source package]:pack= ages' \ + '--add-conflicts-arch=3D[add arch conflicts to source package]:packa= ges' \ + '--add-depends-indep=3D[add indep dependencies to source package]:pa= ckages' \ + '--add-conflicts-indep=3D[add indep conflicts to source package]:pac= kages' \ '--arch=3D[architecture]:architecture:_deb_architectures' \ '--host=3D[host architecture]:architecture:_deb_architectures' \ '--build=3D[build architecture]:architecture:_deb_architectures' \ --=20 2.24.0 --------------7ABB3856B6BB1CDD0CFC8C35-- --X589XP9M2b7A6w7NBcgT7qwHePYQ2heYJ-- --oGW01JHuEuJgWTlytu555iBjhMGi1aRqO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQt4kiVMTxdp/CJ4U4XSUsQeV3XMwUCXe9xXgAKCRAXSUsQeV3X MydvAQDBXjGJF42wHlMeOEaFJs/hA0nFYwIFrNboS7DnWGk4qQD/T7uPVjnxrIDh CNJpY6bur7jXLXxLawgjUtLtukH/Eg0= =YzNR -----END PGP SIGNATURE----- --oGW01JHuEuJgWTlytu555iBjhMGi1aRqO--