2003-07-31 17:26:13 +02:00
|
|
|
#compdef dpkg dpkg-deb dpkg-reconfigure
|
2001-04-02 14:22:24 +02:00
|
|
|
|
|
|
|
local _dpkg_deb_actions _dpkg_common_actions _dpkg_actions _dpkg_options
|
|
|
|
local _dpkg_options_recursive _dpkg_actions_install _dpkg_actions_record_avail
|
|
|
|
local curcontext="$curcontext" context state line expl ret
|
|
|
|
typeset -A opt_args
|
|
|
|
|
2002-03-11 13:56:48 +01:00
|
|
|
_dpkg_deb_actions=(
|
|
|
|
'(--build -b)'{--build,-b}'[build archive]:directory:_files -/'
|
2004-01-21 14:53:28 +01:00
|
|
|
'(--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(-.)"'
|
2002-03-11 13:56:48 +01:00
|
|
|
)
|
2001-04-02 14:22:24 +02:00
|
|
|
|
2002-03-11 13:56:48 +01:00
|
|
|
_dpkg_common_actions=(
|
|
|
|
'--help[show help]'
|
|
|
|
'--version[show version]'
|
|
|
|
'(--license --licence)'{--license,--licence}'[show licencing]'
|
|
|
|
)
|
2001-04-02 14:22:24 +02:00
|
|
|
|
2002-03-11 13:56:48 +01:00
|
|
|
_dpkg_actions=(
|
|
|
|
'(--install -i)'{--install,-i}'[install packages]:*:Debian packages:->install'
|
2004-01-21 14:53:28 +01:00
|
|
|
'--unpack[unpack package]:Debian package:_files -g "*.deb(-.)"'
|
2002-03-11 13:56:48 +01:00
|
|
|
'--configure[reconfigure specified packages]:*:package:->configure'
|
|
|
|
'(--remove -r)'{--remove,-r}'[remove package]:*:package:->remove'
|
|
|
|
'(--purge -P)'{--purge,-P}'[purge package]:*:package:->purge'
|
|
|
|
'(--print-avail -p)'{--print-avail,-p}'[display available details]:packages:_deb_packages avail'
|
|
|
|
'--update-avail[update available]:package file:_files'
|
|
|
|
'--merge-avail[merge available]:package file:_files'
|
|
|
|
'(--record-avail -A)'{--record-avail,-A}'[record available]:*:package files:->record_avail'
|
|
|
|
'--forget-old-unavail[forget uninstalled unavailable]'
|
|
|
|
'--clear-avail[clear available]'
|
|
|
|
'(--list -l)'{--list,-l}'[list packages]:*:packages:->list'
|
|
|
|
'(--status -s)'{--status,-s}'[display package status]:*:packages:->status'
|
|
|
|
'(--audit -C)'{--audit,-C}'[check for broken pkgs]'
|
|
|
|
'--get-selections[get selections]:pattern:'
|
|
|
|
'--set-selections[set selections]'
|
|
|
|
'--yet-to-unpack[list uninstalled]'
|
|
|
|
'(--listfiles, -L)'{--listfiles,-L}'[list owned files]:*:packages:->listfiles'
|
|
|
|
'(--search -S)'{--search,-S}'[search for file owner]:*:pattern:->search'
|
|
|
|
'--print-architecture[print target architecture]'
|
|
|
|
'--print-gnu-build-architecture'
|
|
|
|
'--print-installation-architecture'
|
|
|
|
'--compare-versions[compare version numbers]:*::expression:= ->compare_versions'
|
|
|
|
)
|
2001-04-02 14:22:24 +02:00
|
|
|
|
2002-03-11 13:56:48 +01:00
|
|
|
_dpkg_options=(
|
|
|
|
'--abort-after[abort after errors]:number of errors:'
|
|
|
|
'--admindir=[data directory]:directory:_files -/'
|
|
|
|
'--root=[alternative root]:root:_files -/'
|
|
|
|
'--instdir=[change inst root but not data dir]:_files -/'
|
|
|
|
'(--selected-only -O)'{--selected-only,-O}'[skip unselected packages]'
|
|
|
|
'(--skip-same-version -E)'{--skip-same-version,-E}'[skip packages with same version as installed]'
|
|
|
|
'(--refuse-downgrade -G)'{--refuse-downgrade,-G}'[skip packages with earlier version than installed]'
|
|
|
|
'(--auto-deconfigure -B)'{--auto-deconfigure,-B}'[install can break other packages]'
|
|
|
|
'--largemem[optimize for >4Mb RAM]'
|
|
|
|
'--smallmem[optimize for <4Mb RAM]'
|
|
|
|
'--no-act[show potential actions but do not follow through]'
|
|
|
|
'-D+[debug options]:debug options:(h 1 2 3)'
|
|
|
|
'--debug=[debug options]:debug options:(help 1 2 3)'
|
|
|
|
'--ignore-depends=[ignore depends involving package]:package:_deb_packages avail'
|
|
|
|
--{force,refuse,no-force}'--[forcing options]:what:(auto-select downgrade configure-any hold bad-path not-root overwrite overwrite-diverted depends-version depends confnew confold confdef confmiss conflicts architecture overwrite-dir remove-reinstreq remove-essential)'
|
|
|
|
)
|
2001-04-02 14:22:24 +02:00
|
|
|
|
2002-03-11 13:56:48 +01:00
|
|
|
_dpkg_options_recursive=( '(--recursive -R)'{--recursive,-R}'[recursive]' )
|
2001-04-02 14:22:24 +02:00
|
|
|
|
|
|
|
# not needed anymore?
|
|
|
|
# _dpkg_actions_install=('(--install)-i[install]' '(-i)--install')
|
|
|
|
# _dpkg_actions_record_avail=('(--record-avail)-A[record available]' '(-A)--record-avail')
|
|
|
|
|
|
|
|
case "$service" in
|
2003-07-31 17:26:13 +02:00
|
|
|
dpkg)
|
|
|
|
_arguments -C -s \
|
|
|
|
"$_dpkg_actions[@]" \
|
|
|
|
"$_dpkg_deb_actions[@]" \
|
|
|
|
"$_dpkg_common_actions[@]" \
|
|
|
|
"$_dpkg_options[@]" \
|
|
|
|
"$_dpkg_options_recursive[@]" && return 0
|
|
|
|
;;
|
2001-04-02 14:22:24 +02:00
|
|
|
|
2003-07-31 17:26:13 +02:00
|
|
|
dpkg-deb)
|
|
|
|
_arguments "$_dpkg_deb_actions[@]" \
|
|
|
|
"$_dpkg_common_actions[@]" && return 0
|
|
|
|
;;
|
|
|
|
dpkg-reconfigure)
|
|
|
|
_arguments -s \
|
|
|
|
'(-f --frontend)'{-f,--frontend}'[select frontend to use]:frontend' \
|
|
|
|
'(-p --priority)'{-p,--priority}'[specify min priority of questions]:priority' \
|
|
|
|
'--default-priority[use default question priority]' \
|
|
|
|
'(*)--all[reconfigure all installed packages using debconf]' \
|
|
|
|
'(-u --unseen-only)'{-u,--unseen-only}'[only ask questions not yet seen are asked]' \
|
|
|
|
'--force[reconfigure even packages in broken state]' \
|
|
|
|
'(-)'{-h,--help}'[display help information]' \
|
|
|
|
'*:package:_deb_packages installed' && return 0
|
|
|
|
;;
|
2001-04-02 14:22:24 +02:00
|
|
|
esac
|
|
|
|
|
|
|
|
case "$state" in
|
|
|
|
install|record_avail)
|
2003-07-31 17:26:13 +02:00
|
|
|
_call_function ret _dpkg_$state && return ret
|
2001-04-02 14:22:24 +02:00
|
|
|
# not needed anymore?
|
|
|
|
# "${(@e):-\$_dpkg_actions_${state}}" \
|
2003-07-31 17:26:13 +02:00
|
|
|
_arguments -C -A '-*' -s \
|
|
|
|
"$_dpkg_options[@]" \
|
|
|
|
\!${^_dpkg_actions%%:*} \
|
|
|
|
- recur \
|
|
|
|
"$_dpkg_options_recursive[@]" \
|
|
|
|
'*:directory:_path_files -/' \
|
|
|
|
- nonrecur \
|
2004-01-21 14:53:28 +01:00
|
|
|
'*:Debian package:_path_files -g "*.deb(-.)"'
|
2001-04-02 14:22:24 +02:00
|
|
|
;;
|
2005-01-09 07:23:51 +01:00
|
|
|
remove|status|listfiles)
|
2003-07-31 17:26:13 +02:00
|
|
|
_call_function ret _dpkg_$state && return ret
|
|
|
|
_arguments -C -A "-*" -s "$_dpkg_options[@]" \
|
|
|
|
'*:package:_deb_packages installed'
|
2001-04-02 14:22:24 +02:00
|
|
|
;;
|
2005-01-09 07:23:51 +01:00
|
|
|
purge)
|
|
|
|
_call_function ret _dpkg_$state && return ret
|
|
|
|
_arguments -C -A "-*" -s "$_dpkg_options[@]" \
|
|
|
|
'*:package:_deb_packages xinstalled'
|
|
|
|
;;
|
2001-04-02 14:22:24 +02:00
|
|
|
list)
|
2003-07-31 17:26:13 +02:00
|
|
|
_call_function ret _dpkg_$state && return ret
|
|
|
|
_arguments -C -A "-*" -s "$_dpkg_options[@]" \
|
|
|
|
'*:packages:_deb_packages avail'
|
2001-04-02 14:22:24 +02:00
|
|
|
;;
|
|
|
|
compare_versions)
|
2003-07-31 17:26:13 +02:00
|
|
|
_call_function ret _dpkg_$state && return ret
|
|
|
|
_arguments -C -A "-*" -s \
|
|
|
|
'1:version A:' \
|
|
|
|
'2:operator:(lt le eq ne ge gt lt-nl le-nl ge-nl gt-nl)' \
|
|
|
|
'3:version B:'
|
2001-04-02 14:22:24 +02:00
|
|
|
;;
|
|
|
|
configure)
|
2003-07-31 17:26:13 +02:00
|
|
|
_call_function ret _dpkg_$state && return ret
|
|
|
|
_arguments -C -A "-*" -s '--configure' \
|
|
|
|
"$_dpkg_options[@]" \
|
|
|
|
'(* -a --pending)'{-a,--pending}'[pending packages]' \
|
|
|
|
'*:package:_deb_packages installed'
|
2001-04-02 14:22:24 +02:00
|
|
|
;;
|
2002-07-01 18:04:03 +02:00
|
|
|
search)
|
2003-07-31 17:26:13 +02:00
|
|
|
_call_function ret _dpkg_$state && return ret
|
|
|
|
_files
|
2002-07-01 18:04:03 +02:00
|
|
|
;;
|
2001-04-02 14:22:24 +02:00
|
|
|
esac
|