2015-11-01 06:30:08 +05:30
|
|
|
#compdef xbps-alternatives xbps-checkvers xbps-create xbps-dgraph xbps-install xbps-pkgdb xbps-query xbps-reconfigure xbps-remove xbps-rindex xbps-uchroot xbps-uunshare xbps-uhelper
|
2014-07-22 21:20:58 +05:30
|
|
|
|
|
|
|
_xbps_common=(
|
|
|
|
{-C,--config=-}'[Full path to configuration file]:config file:_files'
|
|
|
|
{-d,--debug}'[Debug mode shown to stderr]'
|
|
|
|
{-h,--help}'[Print help usage]'
|
|
|
|
{-r,--rootdir=-}'[Full path to rootdir]:root dir:_files -/'
|
|
|
|
{-v,--verbose}'[Verbose messages]'
|
|
|
|
{-V,--version}'[Show XBPS version]'
|
|
|
|
)
|
|
|
|
|
2014-09-17 19:32:46 +05:30
|
|
|
_xbps_properties=(
|
|
|
|
architecture
|
|
|
|
archive-compression-type
|
|
|
|
automatic-install
|
|
|
|
build-options
|
|
|
|
conf_files
|
|
|
|
conflicts
|
|
|
|
filename-sha256
|
|
|
|
filename-size
|
|
|
|
homepage
|
|
|
|
install-date
|
|
|
|
install-msg
|
|
|
|
install-script
|
|
|
|
installed_size
|
|
|
|
license
|
|
|
|
maintainer
|
|
|
|
metafile-sha256
|
|
|
|
pkgver
|
|
|
|
preserve
|
|
|
|
provides
|
|
|
|
remove-msg
|
|
|
|
remove-script
|
|
|
|
replaces
|
2015-03-07 18:30:10 +05:30
|
|
|
repolock
|
2014-09-17 19:32:46 +05:30
|
|
|
repository
|
2015-03-07 18:30:10 +05:30
|
|
|
reverts
|
2014-09-17 19:32:46 +05:30
|
|
|
shlib-provides
|
|
|
|
shlib-requires
|
|
|
|
short_desc
|
|
|
|
source-revisions
|
|
|
|
state
|
|
|
|
)
|
|
|
|
|
2014-07-22 21:20:58 +05:30
|
|
|
_xbps_all_packages() {
|
2014-09-17 19:56:56 +05:30
|
|
|
compadd "$@" -- ${${${(f)"$(xbps-query -Rs '')"}#??? }%%-[^- ]# *}
|
2014-07-22 21:20:58 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
_xbps_installed_packages() {
|
2014-09-17 19:56:56 +05:30
|
|
|
compadd "$@" -- ${${${(f)"$(xbps-query -l)"}#?? }%%-[^- ]# *}
|
2014-07-22 21:20:58 +05:30
|
|
|
}
|
|
|
|
|
2015-11-01 06:30:08 +05:30
|
|
|
_xbps_alternatives_groups() {
|
|
|
|
compadd "$@" -- ${${${(f)"$(xbps-alternatives -l)"}##? }%%-# *}
|
|
|
|
}
|
|
|
|
|
|
|
|
_xbps_alternatives() {
|
|
|
|
_arguments -s : \
|
|
|
|
$_xbps_common \
|
|
|
|
{-g,--group}'[Group of alternatives to match]:group:_xbps_alternatives_groups' \
|
|
|
|
{-l,--list}'[List all alternatives]' \
|
|
|
|
{-s,--set}'[Set alternatives]' \
|
|
|
|
'*:installed packages:_xbps_installed_packages'
|
|
|
|
}
|
|
|
|
|
2014-07-22 21:20:58 +05:30
|
|
|
_xbps_checkvers() {
|
|
|
|
_arguments -s : \
|
|
|
|
$_xbps_common \
|
2014-09-26 17:54:06 +05:30
|
|
|
{-D,--distdir}'[Set the path to void-packages]:path:_files -/' \
|
2014-07-22 21:20:58 +05:30
|
|
|
{-i,--installed}'[Check for outdated packages in rootdir]' \
|
2015-11-13 07:10:37 +05:30
|
|
|
{-s,--show-missing}'[List any binary packages which are not built]' \
|
2014-07-22 21:20:58 +05:30
|
|
|
'*:extra packages:_files'
|
|
|
|
}
|
|
|
|
|
|
|
|
_xbps_create() {
|
|
|
|
_arguments -s : \
|
|
|
|
{-A,--architecture}'[Package architecture]:architecture:(i686 i686-musl x86_64 x86_64-musl armv7l armv7l-musl armv6l armv6l-musl noarch)' \
|
|
|
|
{-B,--built-with}'[Package builder string]:package builder: ' \
|
|
|
|
{-C,--conflicts}'[Conflicts]:conflicts: ' \
|
|
|
|
{-D,--dependencies}'[Dependencies]:dependencies: ' \
|
|
|
|
{-F,--config-files}'[Configuration files]:configuration files: ' \
|
|
|
|
{-H,--homepage}'[Homepage]:homepage: ' \
|
|
|
|
{-h,--help}'[Show help]' \
|
|
|
|
{-l,--license}'[License]:license: ' \
|
|
|
|
{-M,--mutable-files}'[Mutable files list]:mutable files: ' \
|
|
|
|
{-m,--maintainer}'[Maintainer]:maintainer: ' \
|
|
|
|
{-n,--pkgver}'[Package name/version tuple]:package name/version: ' \
|
|
|
|
{-P,--provides}'[Provides]:provides: ' \
|
|
|
|
{-p,--preserve}'[Enable package preserve boolean]' \
|
|
|
|
{-q,--quiet}'[Work silently]' \
|
|
|
|
{-R,--replaces}'[Replaces]:replaces: ' \
|
|
|
|
{-S,--long-desc}'[Long description]:long description: ' \
|
|
|
|
{-s,--desc}'[Short description]:short description: ' \
|
|
|
|
{-t,--tags}'[A list of tags/categories]:tags: ' \
|
|
|
|
{-V,--version}'[Prints XBPS release version]' \
|
|
|
|
--build-options'[A string with the used build options]:used build options: ' \
|
|
|
|
--compression'[Compression format]:compression format:(gzip bzip2 xz)' \
|
|
|
|
--shlib-provides'[List of provided shared libraries]:provided shared libraries: ' \
|
|
|
|
--shlib-requires'[List of required shared libraries]:required shared libraries: '
|
|
|
|
}
|
|
|
|
|
|
|
|
_xbps_dgraph() {
|
|
|
|
_arguments : \
|
2015-03-07 18:30:10 +05:30
|
|
|
{-C,--config=-}'[Full path to configuration file]:config file:_files' \
|
|
|
|
{-c,--graph-config}'[Path to configuration file]:config file:_files' \
|
|
|
|
{-d,--debug}'[Debug mode shown to stderr]' \
|
|
|
|
{-h,--help}'[Print help usage]' \
|
|
|
|
{-M,--memory-sync}'[Keep remote repository data in memory only]' \
|
|
|
|
{-r,--rootdir}'[Full path to rootdir]:root dir:_files -/' \
|
|
|
|
{-R,--repository}'[Enable repository mode]' \
|
|
|
|
- '(mode)' \
|
|
|
|
{-g,--gen-config}'[Generate a default config file]' \
|
|
|
|
{-f,--fulldeptree}'[Generate a dependency graph]' \
|
|
|
|
{-m,--metadata}'[Generate a metadata graph]' \
|
2014-07-22 21:20:58 +05:30
|
|
|
':package:_xbps_all_packages'
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_xbps_install() {
|
|
|
|
_arguments -s : \
|
|
|
|
$_xbps_common \
|
|
|
|
{-A,--automatic}'[Set automatic installation mode]' \
|
|
|
|
{-c,--cachedir=-}'[Full path to cachedir]:cache dir:_files -/' \
|
2015-11-13 07:10:37 +05:30
|
|
|
{-n,--dry-run}'[Dry-run mode]' \
|
2014-07-22 21:20:58 +05:30
|
|
|
{-f,--force}'[Force package re-installation]' \
|
2015-03-07 18:30:10 +05:30
|
|
|
{-i,--ignore-conf-repos}'[Ignore repositories defined in xbps.d]' \
|
|
|
|
{-M,--memory-sync}'[Keep remote repository data in memory only]' \
|
|
|
|
'*'{-R,--repository=-}'[Add repository to the top of the list]:repository url:_files -/' \
|
2014-07-22 21:20:58 +05:30
|
|
|
{-S,--sync}'[Sync remote repository index]' \
|
|
|
|
{-u,--update}'[Update target packages]' \
|
2015-11-13 07:10:37 +05:30
|
|
|
{-U,--unpack-only}'[Unpack packages without configuring]' \
|
2014-07-22 21:20:58 +05:30
|
|
|
{-y,--yes}'[Assume yes to all questions]' \
|
|
|
|
'*:available packages:_xbps_all_packages'
|
|
|
|
}
|
|
|
|
|
|
|
|
_xbps_pkgdb() {
|
|
|
|
_arguments -s : \
|
|
|
|
$_xbps_common \
|
|
|
|
{-a,--all}'[Process all packages]' \
|
2015-03-07 18:30:10 +05:30
|
|
|
{-m,--mode}'[Change to this mode]:mode:(auto manual hold unhold repolock repounlock)' \
|
|
|
|
{-u,--update}'[Update pkgdb to the latest format]' \
|
2014-07-22 21:20:58 +05:30
|
|
|
'*:installed packages:_xbps_installed_packages'
|
|
|
|
}
|
|
|
|
|
|
|
|
_xbps_query() {
|
|
|
|
_arguments -s : \
|
|
|
|
$_xbps_common \
|
|
|
|
{-c,--cachedir=-}'[Full path to cachedir]:cache dir:_files -/' \
|
2015-03-07 18:30:10 +05:30
|
|
|
{-i,--ignore-conf-repos}'[Ignore repositories defined in xbps.d]' \
|
|
|
|
{-M,--memory-sync}'[Keep remote repository data in memory only]' \
|
2014-09-17 19:32:46 +05:30
|
|
|
{-p,--property=-}'[Show properties]:property:($_xbps_properties)' \
|
2014-07-22 21:20:58 +05:30
|
|
|
--regex'[Use Extended Regular Expressions to match]' \
|
2014-09-15 02:39:22 +05:30
|
|
|
--fulldeptree'[Full dependency tree for -x/--deps]' \
|
2014-07-22 21:20:58 +05:30
|
|
|
{-R,--repository}'[Enable repository mode]' \
|
2015-03-07 18:30:10 +05:30
|
|
|
'*'--repository=-'[Add repository to the top of the list]:repository url:_files -/' \
|
|
|
|
- '(mode)' \
|
2014-07-22 21:20:58 +05:30
|
|
|
{-l,--list-pkgs}'[List installed packages]' \
|
|
|
|
{-L,--list-repos}'[List registered repositories]' \
|
|
|
|
{-H,--list-hold-pkgs}'[List packages on hold state]' \
|
|
|
|
{-m,--list-manual-pkgs}'[List packages installed explicitly]' \
|
|
|
|
{-O,--list-orphans}'[List package orphans]' \
|
|
|
|
{-o,--ownedby}'[Search for package files]:package file:_files' \
|
|
|
|
{-S,--show}'[Show information]:package:_xbps_all_packages' \
|
|
|
|
{-s,--search}'[Search for packages]:search string: ' \
|
2015-03-07 18:30:10 +05:30
|
|
|
--cat=-'[Print file from binpkg to stdout]:file name:_files:package:_xbps_all_packages' \
|
2014-07-22 21:20:58 +05:30
|
|
|
{-f,--files}'[Show package files]:package:_xbps_all_packages' \
|
|
|
|
{-x,--deps}'[Show dependencies]:package:_xbps_all_packages' \
|
|
|
|
{-X,--revdeps}'[Show reverse dependencies]:package:_xbps_all_packages' \
|
|
|
|
- '(default)' \
|
|
|
|
':package:_xbps_all_packages'
|
|
|
|
}
|
|
|
|
|
|
|
|
_xbps_reconfigure() {
|
|
|
|
_arguments -s : \
|
|
|
|
$_xbps_common \
|
|
|
|
{-a,--all}'[Process all packages]' \
|
|
|
|
{-f,--force}'[Force reconfiguration]' \
|
2015-03-07 18:30:10 +05:30
|
|
|
'*'{-i,--ignore}'[Ignore package for reconfigure]:installed packages:_xbps_installed_packages' \
|
2014-07-22 21:20:58 +05:30
|
|
|
'*:installed packages:_xbps_installed_packages'
|
|
|
|
}
|
|
|
|
|
|
|
|
_xbps_remove() {
|
|
|
|
_arguments -s : \
|
|
|
|
$_xbps_common \
|
|
|
|
{-c,--cachedir=-}'[Full path to cachedir]:cache dir:_files -/' \
|
2015-03-07 18:30:10 +05:30
|
|
|
{-F,--force-revdeps}'[Force package removal even with revdeps/unresolved shared libraries]' \
|
2014-07-22 21:20:58 +05:30
|
|
|
{-f,--force}'[Force package files removal]' \
|
|
|
|
{-O,--clean-cache}'[Remove obsolete packages in cachedir]' \
|
|
|
|
{-o,--remove-orphans}'[Remove package orphans]' \
|
2015-11-01 06:30:08 +05:30
|
|
|
{-n,--dry-run}'[Dry-run mode]' \
|
2014-07-22 21:20:58 +05:30
|
|
|
{-R,--recursive}'[Recursively remove dependencies]' \
|
|
|
|
{-y,--yes}'[Assume yes to all questions]' \
|
|
|
|
'*:installed packages:_xbps_installed_packages'
|
|
|
|
}
|
|
|
|
|
|
|
|
_xbps_rindex() {
|
|
|
|
_arguments -s : \
|
2015-03-07 18:30:10 +05:30
|
|
|
{-d,--debug}'[Debug mode shown to stderr]' \
|
2014-07-22 21:20:58 +05:30
|
|
|
{-f,--force}'[Force mode to overwrite entry in add mode]' \
|
|
|
|
{-h,--help}'[Print help usage]' \
|
|
|
|
{-v,--verbose}'[Verbose messages]' \
|
|
|
|
{-V,--version}'[Show XBPS version]' \
|
|
|
|
'--privkey[Path to the private key for signing]:private key path:_files' \
|
|
|
|
'--signedby[Signature details]:signature details: ' \
|
2015-03-07 18:30:10 +05:30
|
|
|
- '(mode)' \
|
2014-07-22 21:20:58 +05:30
|
|
|
{-a,--add}'[Add package to repository index]' \
|
|
|
|
{-c,--clean}'[Clean repository index]' \
|
|
|
|
{-r,--remove-obsoletes}'[Removes obsolete packages from repository]' \
|
|
|
|
{-s,--sign}'[Sign repository index]' \
|
2015-08-20 05:27:10 +05:30
|
|
|
{-S,--sign-pkg}'[Sign binary package archive]' \
|
2014-07-22 21:20:58 +05:30
|
|
|
':repository dir:_files -/' \
|
|
|
|
'*:packages:_files'
|
|
|
|
}
|
|
|
|
|
|
|
|
_xbps_uchroot() {
|
|
|
|
_arguments \
|
|
|
|
'-D[distdir]:distdir:_files -/' \
|
|
|
|
'-H[hostdir]:hostdir:_files -/' \
|
|
|
|
'-S[shmdir]:shmdir:_files -/' \
|
2015-03-07 18:30:10 +05:30
|
|
|
':chroot dir:_files -/' \
|
2014-07-22 21:20:58 +05:30
|
|
|
':command: _command_names -e' \
|
|
|
|
'*::arguments: _normal'
|
|
|
|
}
|
|
|
|
|
|
|
|
_xbps_uhelper() {
|
|
|
|
local ret=1
|
|
|
|
_arguments \
|
|
|
|
{-C,--config=-}'[Full path to configuration file]:config file:_files' \
|
|
|
|
{-d,--debug}'[Debug mode shown to stderr]' \
|
|
|
|
{-r,--rootdir=-}'[Full path to rootdir]:root dir:_files -/' \
|
|
|
|
{-V,--version}'[Show XBPS version]' \
|
|
|
|
'1:action:->actions' \
|
|
|
|
'*:: :->args' && ret=0
|
|
|
|
case $state in
|
|
|
|
actions)
|
2015-03-07 18:30:10 +05:30
|
|
|
_values "actions" binpkgarch binpkgver cmpver digest fetch getpkgdepname \
|
2014-07-22 21:20:58 +05:30
|
|
|
getpkgname getpkgrevision getpkgversion \
|
2015-03-07 18:30:10 +05:30
|
|
|
pkgmatch version real-version arch getsystemdir
|
2014-07-22 21:20:58 +05:30
|
|
|
ret=0;;
|
|
|
|
args)
|
|
|
|
case $words[1] in
|
2015-03-07 18:30:10 +05:30
|
|
|
binpkgarch) _arguments ':binpkg:' && ret=0;;
|
|
|
|
binpkgver) _arguments ':binpkg:' && ret=0;;
|
2014-07-22 21:20:58 +05:30
|
|
|
cmpver) _arguments ':installed version: ' ':required version: ' && ret=0;;
|
|
|
|
digest) _arguments '*:files:_files' && ret=0;;
|
|
|
|
fetch) _arguments '*:urls: ' && ret=0;;
|
|
|
|
getpkgdepname) _arguments '*:string: ' && ret=0;;
|
|
|
|
getpkgname) _arguments '*:string: ' && ret=0;;
|
|
|
|
getpkgrevision) _arguments '*:string: ' && ret=0;;
|
|
|
|
getpkgversion) _arguments '*:string: ' && ret=0;;
|
|
|
|
pkgmatch) _arguments ':version: ' ':pattern: ' && ret=0;;
|
|
|
|
real-version) _arguments ':package:_xbps_installed_packages' && ret=0;;
|
|
|
|
version) _arguments ':package:_xbps_installed_packages' && ret=0;;
|
2015-03-07 18:30:10 +05:30
|
|
|
arch) ret=0;;
|
|
|
|
getsystemdir) ret=0;;
|
2014-07-22 21:20:58 +05:30
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
return $ret
|
|
|
|
}
|
|
|
|
|
|
|
|
_xbps() {
|
|
|
|
case "$service" in
|
2015-11-01 06:30:08 +05:30
|
|
|
xbps-alternatives) _xbps_alternatives "$@";;
|
2014-07-22 21:20:58 +05:30
|
|
|
xbps-checkvers) _xbps_checkvers "$@";;
|
|
|
|
xbps-create) _xbps_create "$@";;
|
|
|
|
xbps-dgraph) _xbps_dgraph "$@";;
|
|
|
|
xbps-install) _xbps_install "$@";;
|
|
|
|
xbps-pkgdb) _xbps_pkgdb "$@";;
|
|
|
|
xbps-query) _xbps_query "$@";;
|
|
|
|
xbps-reconfigure) _xbps_reconfigure "$@";;
|
|
|
|
xbps-remove) _xbps_remove "$@";;
|
|
|
|
xbps-rindex) _xbps_rindex "$@";;
|
|
|
|
xbps-uchroot) _xbps_uchroot "$@";;
|
2015-03-07 18:30:10 +05:30
|
|
|
xbps-uunshare) _xbps_uchroot "$@";;
|
2014-07-22 21:20:58 +05:30
|
|
|
xbps-uhelper) _xbps_uhelper "$@";;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
_xbps "$@"
|