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=-1.0 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham 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 ed6f7624 for ; Fri, 22 Mar 2019 01:03:17 +0000 (UTC) Received: (qmail 28406 invoked by alias); 22 Mar 2019 01:03:02 -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: 44160 Received: (qmail 9092 invoked by uid 1010); 22 Mar 2019 01:03:02 -0000 X-Qmail-Scanner-Diagnostics: from mail-it1-f194.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.1/25393. spamassassin: 3.4.2. Clear:RC:0(209.85.166.194):SA:0(-1.9/5.0):. Processed in 2.663249 secs); 22 Mar 2019 01:03:02 -0000 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.194 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=E7CPMkpfDb634FQJiNewC/2M+zCrfbtHY3BRTI8uLss=; b=mg5eKcHLwyxgEjxzBHKle9IZcHtGvXRJt2g6wLqvRE5Em9hk7A3M0Q2G7W69UuxRFI W1muGmUnlW/Tv83Zqo6/3ZmV0kZkmPAGqHzMht9UGfGV6UyXUdo6orGm3ng+GKtki/ES N0OsPAZ/skqIPonKTQOz2Ill6tyeRUpC6XEL9PfnJxegayuCIMaaiQ4hkLg4dGLnABMz SQ5xm9WhPxzUIlCotf5O+GmILjMYwjM7sux9yAzshPdiUoPPfE86jCssBMi6NJ2DChcv VcJ8UiDcIRbpOOD4K9Chc9N5EL+PmxRL8skMb0Fr3Au734R/u1CRKxbNoBPEdXlt6pVP O3YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=E7CPMkpfDb634FQJiNewC/2M+zCrfbtHY3BRTI8uLss=; b=Q3P7irrzex36j8ElF0xCQIp7hNKz31ryi8K87q2V8fIRA8ajtxu8t/W22s5bK2S5lR 4ugyPIWzvsqhReRPJjz/D9ZqZ2KRF4thzVH6xaSA6EacG5x8sVeOlPQEN17gTjpY51ov Qq3TrIRRcBanXr0LIzBDVgSyxzpRZmKvfZtuIsN/qJ5tBNblVlLHQ+NdezUXzCrj3YWQ pT3QlTwwegBL+nmxCyXOZV2yLKWceg301NHfvAQFvMfN3VYbdDlsGrI/N1R9OZpJ1Svo 4v4WAKSrklxrXQQCkUc8TYtbHgXQAlmArksboIJU4/DR3IboVqSg8OgB7oZHxY2Y7Gln A8Pw== X-Gm-Message-State: APjAAAVAZPxrr1L6BW4x2iL/wK4MUTVyIyDEWz2AQ6gvuclHTMcEVr5X 4Wmu0JKvlWhq105Wc71YnzaKpSORjwam0w== X-Google-Smtp-Source: APXvYqyMc4jXo2GFJ20IB9LybjTsN3uyXbr+hQUHZvVcn4DMOpvzpRsyR4iC5Pvk9192sPrBCtO/6Q== X-Received: by 2002:a02:c045:: with SMTP id u5mr5307356jam.95.1553216546142; Thu, 21 Mar 2019 18:02:26 -0700 (PDT) From: dana Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: [PATCH] Completion: Support .ddeb/.udeb for Debian packages Date: Thu, 21 Mar 2019 20:02:25 -0500 References: <0EDB69C7-C277-49DC-B3ED-59264D421F4B@dana.is> To: Zsh hackers list In-Reply-To: <0EDB69C7-C277-49DC-B3ED-59264D421F4B@dana.is> Message-Id: <48A79D26-6DD4-43A3-BE6E-5B672FB682DC@dana.is> X-Mailer: Apple Mail (2.3445.9.1) On 21 Mar 2019, at 18:55, dana wrote: >This just updates every function that completes *.deb files to also = offer >*.ddeb and *.udeb. (Several already included the latter, but none the = former) Matthew suggested that i make a type function for this. It appears in = enough places that that seems reasonable to me. So here's that instead dana diff --git a/Completion/Debian/Type/_deb_files = b/Completion/Debian/Type/_deb_files new file mode 100644 index 000000000..e84871cc4 --- /dev/null +++ b/Completion/Debian/Type/_deb_files @@ -0,0 +1,17 @@ +#autoload + +# This function is used to generate file names for Debian package files = (.deb +# and friends). In addition to the options supported by _files, it = understands +# the following: +# +# -c Include .changes and .dsc files + +local -a _expl _fopts _c _exts=3D( deb ddeb udeb ) + +zparseopts -a _fopts -D -E - \ + c=3D_c 1 2 F+: J+: M+: n P+: q r+: R+: S+: V+: W+: X+: + +(( $#_c )) && _exts+=3D( changes dsc ) + +_description files _expl 'Debian package' +_files "${(@)_fopts}" "${(@)_expl}" -g "*.(${(j<|>)_exts})(-.)" diff --git a/Completion/Debian/Command/_apt = b/Completion/Debian/Command/_apt index dd837379c..4486aa26d 100644 --- a/Completion/Debian/Command/_apt +++ b/Completion/Debian/Command/_apt @@ -411,7 +411,7 @@ _apt-cmd () { /$'(install|download|source|build-dep)\0'/ -'subcmd=3D${match%?}' = \ /$'[^\0]#\0'/ ':packages::_deb_packages -qr "\n\t\- /=3D" = "$expl_packages[@]" avail' \# \ \( \ - // '%(.|)/%' -'[[ $subcmd =3D install ]]' /'[]'/ ':files:package = file:_files -g "*.(changes|deb|dsc)(-.)"' \| \ + // '%(.|)/%' -'[[ $subcmd =3D install ]]' /'[]'/ ':files: :_deb_files = -c' \| \ /$'[^\0/=3D]#\/'/ /'[]'/ ':apt-releases:release name:_apt_releases' \| = \ /$'[^\0/=3D]#=3D'/ /'[]'/ ':apt-package-versions:package = version:_apt_versions_of_binary_package' \| \ \) \ diff --git a/Completion/Debian/Command/_apt-file = b/Completion/Debian/Command/_apt-file index 98a93fdd3..5b24707d2 100644 --- a/Completion/Debian/Command/_apt-file +++ b/Completion/Debian/Command/_apt-file @@ -36,7 +36,7 @@ case $state in case $line[1] in search|find) if (( $#opt_args[(I)(-D|--from-deb)] )); then - _wanted files expl 'debian package' _files -g '*.deb(-.)' + _deb_files elif (( $#opt_args[(I)(-f|--from-file)] )); then _files else diff --git a/Completion/Debian/Command/_debdiff = b/Completion/Debian/Command/_debdiff index 6f8519a4a..9e8ffd594 100644 --- a/Completion/Debian/Command/_debdiff +++ b/Completion/Debian/Command/_debdiff @@ -17,6 +17,6 @@ _arguments \ '(-h --help)'{-h,--help}'[show help]' \ '(-v --version)'{-v,--version}'[show version]' \ '(-q --quiet)'{-q,--quiet}'[be quiet if no differences]' \ - '--from:debs:_files -g "*.deb(-.)"' \ - '--to:debs:_files -g "*.deb(-.)"' \ - '*:file to compare:_files -g "*.(deb|changes|dsc)(-.)"' + '--from: :_deb_files' \ + '--to: :_deb_files' \ + '*:file to compare:_deb_files -c' diff --git a/Completion/Debian/Command/_dpkg = b/Completion/Debian/Command/_dpkg index 5c8f17f03..3477e6116 100644 --- a/Completion/Debian/Command/_dpkg +++ b/Completion/Debian/Command/_dpkg @@ -18,13 +18,13 @@ _dpkg_deb_only_actions=3D( =20 _dpkg_deb_actions=3D( '(--build -b)'{--build,-b}'[build archive]:directory:_files -/' - '(--contents -c)'{--contents,-c}'[list contents]:Debian = package:_files -g "*.u#deb(-.)"' - '(--info -I)'{--info,-I}'[show info]:Debian package:_files -g = "*.u#deb(-.)"' - '(--field -f)'{--field,-f}'[show fields]:Debian package:_files -g = "*.u#deb(-.)"' - '(--control -e)'{--control,-e}'[extract control]:Debian = package:_files -g "*.u#deb(-.)"' - '(--extract -x)'{--extract,-x}'[extract files]:Debian package:_files = -g "*.u#deb(-.)"' - '(--vextract -X)'{--vextract,-X}'[extract and list files]:Debian = package:_files -g "*.u#deb(-.)"' - '--fsys-tarfile[output fs tarfile]:Debian package:_files -g = "*.u#deb(-.)"' + '(--contents -c)'{--contents,-c}'[list contents]: :_deb_files' + '(--info -I)'{--info,-I}'[show info]: :_deb_files' + '(--field -f)'{--field,-f}'[show fields]: :_deb_files' + '(--control -e)'{--control,-e}'[extract control]: :_deb_files' + '(--extract -x)'{--extract,-x}'[extract files]: :_deb_files' + '(--vextract -X)'{--vextract,-X}'[extract and list files]: = :_deb_files' + '--fsys-tarfile[output fs tarfile]: :_deb_files' ) =20 _dpkg_common_actions=3D( @@ -35,7 +35,7 @@ _dpkg_common_actions=3D( =20 _dpkg_actions=3D( '(--install -i)'{--install,-i}'[install packages]:*:Debian = packages:->install' - '--unpack[unpack package]:Debian package:_files -g "*.deb(-.)"' + '--unpack[unpack package]: :_deb_files' '--configure[reconfigure specified packages]:*:package:->configure' '(--remove -r)'{--remove,-r}'[remove package]:*:package:->remove' '(--purge -P)'{--purge,-P}'[purge package]:*:package:->purge' @@ -76,7 +76,7 @@ _dpkg_options=3D( _dpkg_options_recursive=3D( '(--recursive = -R)'{--recursive,-R}'[recursive]' ) =20 _dpkg_deb_and_query_only_actions=3D( - '(--show -W)'{--show,-W}'[show package info]:Debian package:_files = -g \*.u\#deb\(-.\)' + '(--show -W)'{--show,-W}'[show package info]: :_deb_files' ) =20 _dpkg_deb_and_query_only_options=3D( @@ -147,7 +147,7 @@ case "$state" in "$_dpkg_options_recursive[@]" \ '*:directory:_path_files -/' \ - nonrecur \ - '*:Debian package:_path_files -g "*.deb(-.)"' + '*: :_deb_files' ;; remove|status|listfiles) _call_function ret _dpkg_$state && return ret diff --git a/Completion/Debian/Command/_lintian = b/Completion/Debian/Command/_lintian index d60acc9ed..71e71ee3d 100644 --- a/Completion/Debian/Command/_lintian +++ b/Completion/Debian/Command/_lintian @@ -38,7 +38,7 @@ case "$service" in '(-s --source)'{-s,--source}'[the following packages are source]' = \ '--udeb[the following packages are udebs]' \ '(-p --packages-file)'{-p,--packages-file}'[process packages = listed in file]:list:_files' \ - '*:package:_files -g "*.(changes|deb|dsc)(-.)"' && return 0 + '*: :_deb_files -c' && return 0 ;; =20 (lintian-info) diff --git a/Completion/Debian/Command/_piuparts = b/Completion/Debian/Command/_piuparts index a1b6666a3..1da0e85e9 100644 --- a/Completion/Debian/Command/_piuparts +++ b/Completion/Debian/Command/_piuparts @@ -24,7 +24,7 @@ case "$state" in if (( $+opt_args[-a] )); then _deb_packages avail else - _files -g '*.deb(-.)' + _deb_files fi ;; esac