From: dana <dana@dana.is>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: [PATCH] Completion: Support .ddeb/.udeb for Debian packages
Date: Thu, 21 Mar 2019 18:55:40 -0500 [thread overview]
Message-ID: <0EDB69C7-C277-49DC-B3ED-59264D421F4B@dana.is> (raw)
This just updates every function that completes *.deb files to also offer
*.ddeb and *.udeb. (Several already included the latter, but none the former)
There are also some functions like the ones for dak and madison where a
'binary type' is completed — most of those handle udeb, but i'm unsure if ddeb
is a separate type for their purposes, so i've left them alone
dana
diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt
index dd837379c..fc2c0916f 100644
--- a/Completion/Debian/Command/_apt
+++ b/Completion/Debian/Command/_apt
@@ -411,7 +411,7 @@ _apt-cmd () {
/$'(install|download|source|build-dep)\0'/ -'subcmd=${match%?}' \
/$'[^\0]#\0'/ ':packages::_deb_packages -qr "\n\t\- /=" "$expl_packages[@]" avail' \# \
\( \
- // '%(.|)/%' -'[[ $subcmd = install ]]' /'[]'/ ':files:package file:_files -g "*.(changes|deb|dsc)(-.)"' \| \
+ // '%(.|)/%' -'[[ $subcmd = install ]]' /'[]'/ ':files:package file:_files -g "*.(changes|[du]#deb|dsc)(-.)"' \| \
/$'[^\0/=]#\/'/ /'[]'/ ':apt-releases:release name:_apt_releases' \| \
/$'[^\0/=]#='/ /'[]'/ ':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..89943c160 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(-.)'
+ _wanted files expl 'debian package' _files -g '*.[du]#deb(-.)'
elif (( $#opt_args[(I)(-f|--from-file)] )); then
_files
else
diff --git a/Completion/Debian/Command/_debdiff b/Completion/Debian/Command/_debdiff
index 6f8519a4a..59b2a109a 100644
--- a/Completion/Debian/Command/_debdiff
+++ b/Completion/Debian/Command/_debdiff
@@ -19,4 +19,4 @@ _arguments \
'(-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)(-.)"'
+ '*:file to compare:_files -g "*.([du]#deb|changes|dsc)(-.)"'
diff --git a/Completion/Debian/Command/_dpkg b/Completion/Debian/Command/_dpkg
index 5c8f17f03..5458344db 100644
--- a/Completion/Debian/Command/_dpkg
+++ b/Completion/Debian/Command/_dpkg
@@ -18,13 +18,13 @@ _dpkg_deb_only_actions=(
_dpkg_deb_actions=(
'(--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]:Debian package:_files -g "*.[du]#deb(-.)"'
+ '(--info -I)'{--info,-I}'[show info]:Debian package:_files -g "*.[du]#deb(-.)"'
+ '(--field -f)'{--field,-f}'[show fields]:Debian package:_files -g "*.[du]#deb(-.)"'
+ '(--control -e)'{--control,-e}'[extract control]:Debian package:_files -g "*.[du]#deb(-.)"'
+ '(--extract -x)'{--extract,-x}'[extract files]:Debian package:_files -g "*.[du]#deb(-.)"'
+ '(--vextract -X)'{--vextract,-X}'[extract and list files]:Debian package:_files -g "*.[du]#deb(-.)"'
+ '--fsys-tarfile[output fs tarfile]:Debian package:_files -g "*.[du]#deb(-.)"'
)
_dpkg_common_actions=(
@@ -35,7 +35,7 @@ _dpkg_common_actions=(
_dpkg_actions=(
'(--install -i)'{--install,-i}'[install packages]:*:Debian packages:->install'
- '--unpack[unpack package]:Debian package:_files -g "*.deb(-.)"'
+ '--unpack[unpack package]:Debian package:_files -g "*.[du]#deb(-.)"'
'--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=(
_dpkg_options_recursive=( '(--recursive -R)'{--recursive,-R}'[recursive]' )
_dpkg_deb_and_query_only_actions=(
- '(--show -W)'{--show,-W}'[show package info]:Debian package:_files -g \*.u\#deb\(-.\)'
+ '(--show -W)'{--show,-W}'[show package info]:Debian package:_files -g "*.[du]#deb(-.)"'
)
_dpkg_deb_and_query_only_options=(
@@ -147,7 +147,7 @@ case "$state" in
"$_dpkg_options_recursive[@]" \
'*:directory:_path_files -/' \
- nonrecur \
- '*:Debian package:_path_files -g "*.deb(-.)"'
+ '*:Debian package:_path_files -g "*.[du]#deb(-.)"'
;;
remove|status|listfiles)
_call_function ret _dpkg_$state && return ret
diff --git a/Completion/Debian/Command/_lintian b/Completion/Debian/Command/_lintian
index d60acc9ed..2b0f7cf36 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
+ '*:package:_files -g "*.(changes|[du]#deb|dsc)(-.)"' && return 0
;;
(lintian-info)
diff --git a/Completion/Debian/Command/_piuparts b/Completion/Debian/Command/_piuparts
index a1b6666a3..3b612a3ad 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(-.)'
+ _files -g '*.[du]#deb(-.)'
fi
;;
esac
next reply other threads:[~2019-03-21 23:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-21 23:55 dana [this message]
2019-03-22 1:02 ` dana
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0EDB69C7-C277-49DC-B3ED-59264D421F4B@dana.is \
--to=dana@dana.is \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).