mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-02 22:11:54 +02:00
44160 (tweaked): Completion: Add _deb_files, match *.ddeb
Add new helper function for generating Debian package/control files, use it where applicable Adjusted only for minor white-space corruption in original patch
This commit is contained in:
parent
52f3266bd0
commit
683c2cc1ca
8 changed files with 45 additions and 17 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2019-03-25 dana <dana@dana.is>
|
||||
|
||||
* 44160 (tweaked): Completion/Debian/Command/_apt,
|
||||
Completion/Debian/Command/_apt-file,
|
||||
Completion/Debian/Command/_debdiff,
|
||||
Completion/Debian/Command/_dpkg,
|
||||
Completion/Debian/Command/_lintian,
|
||||
Completion/Debian/Command/_piuparts,
|
||||
Completion/Debian/Type/_deb_files: Add _deb_files helper with
|
||||
support for *.ddeb, use it where applicable
|
||||
|
||||
2019-03-25 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
||||
|
||||
* 44176: Src/Modules/zftp.c: warn only if off_t is longer than long
|
||||
|
|
|
@ -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: :_deb_files -c' \| \
|
||||
/$'[^\0/=]#\/'/ /'[]'/ ':apt-releases:release name:_apt_releases' \| \
|
||||
/$'[^\0/=]#='/ /'[]'/ ':apt-package-versions:package version:_apt_versions_of_binary_package' \| \
|
||||
\) \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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]: :_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'
|
||||
)
|
||||
|
||||
_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]: :_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=(
|
|||
_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]: :_deb_files'
|
||||
)
|
||||
|
||||
_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(-.)"'
|
||||
'*: :_deb_files'
|
||||
;;
|
||||
remove|status|listfiles)
|
||||
_call_function ret _dpkg_$state && return ret
|
||||
|
|
|
@ -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
|
||||
;;
|
||||
|
||||
(lintian-info)
|
||||
|
|
|
@ -24,7 +24,7 @@ case "$state" in
|
|||
if (( $+opt_args[-a] )); then
|
||||
_deb_packages avail
|
||||
else
|
||||
_files -g '*.deb(-.)'
|
||||
_deb_files
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
|
17
Completion/Debian/Type/_deb_files
Normal file
17
Completion/Debian/Type/_deb_files
Normal file
|
@ -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=( deb ddeb udeb )
|
||||
|
||||
zparseopts -a _fopts -D -E - \
|
||||
c=_c 1 2 F+: J+: M+: n P+: q r+: R+: S+: V+: W+: X+:
|
||||
|
||||
(( $#_c )) && _exts+=( changes dsc )
|
||||
|
||||
_description files _expl 'Debian package'
|
||||
_files "${(@)_fopts}" "${(@)_expl}" -g "*.(${(j<|>)_exts})(-.)"
|
Loading…
Reference in a new issue