diff --git a/data/_xbps b/data/_xbps index 449f6cc0..2a76a51e 100644 --- a/data/_xbps +++ b/data/_xbps @@ -1,12 +1,29 @@ -#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 +#compdef -p xbps-* -_xbps_common=( - {-C,--config=-}'[Full path to configuration file]:config file:_files' +_xbps_common_conf=( + {-C,--config=-}'[Path to configuration directory (xbps.d)]:conf dir [xbps.d]:_files -/' + {-r,--rootdir=-}'[Full path to rootdir]:root dir [/]:_xbps_full_path -/' +) + +_xbps_common_debug=( {-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]' +) + +_xbps_common_info=( + '(- :)'{-h,--help}'[Show usage]' + '(- :)'{-V,--version}'[Show XBPS version]' +) + +_xbps_common=( + $_xbps_common_conf + $_xbps_common_debug + $_xbps_common_info +) + +_xbps_common_without_conf=( + $_xbps_common_debug + $_xbps_common_info ) _xbps_properties=( @@ -45,95 +62,279 @@ _xbps_properties=( state ) +(( $+functions[_xbps_all_packages] )) || _xbps_all_packages() { compadd "$@" -- ${${${(f)"$(xbps-query -Rs '')"}#??? }%%-[^- ]# *} } +(( $+functions[_xbps_installed_packages] )) || _xbps_installed_packages() { compadd "$@" -- ${${${(f)"$(xbps-query -l)"}#?? }%%-[^- ]# *} } +(( $+functions[_xbps_alternatives_groups] )) || _xbps_alternatives_groups() { compadd "$@" -- ${${${(f)"$(xbps-alternatives -l)"}##? }%%-# *} } +(( $+functions[_xbps_packages_auto] )) || +_xbps_packages_auto() { + _xbps_packages "$@" ${${opt_args[(i)-R|--repository]:+repo}:-installed} +} + +(( $+functions[_xbps_repo_url] )) || +_xbps_repo_url() { + local -a alts=( 'local-repositories:repository url:_files -/' ) + (( $+functions[_xmirrors] )) && + alts+=( 'mirror-repositories:mirror url:_xmirrors --repos' ) + alts+=( 'urls:repository url:_urls' ) + _alternative $alts +} + +(( $+functions[_xbps_full_path] )) || +_xbps_full_path() { + local -a pref + [[ $PREFIX[1] != (\~|\$) ]] && pref=( -P / ) + _files "$@" $pref -W / +} + +(( $+functions[_xbps_chroot_args] )) || +_xbps_chroot_args() { + if (( CURRENT <= 1 )); then + local -a expl + _description directories expl 'chroot dir' + _files "$expl[@]" -/ + elif (( CURRENT == 2 )); then + _command_names -e + else + shift words + (( CURRENT -= 1 )) + _compskip=all + _normal -s + fi +} + +(( $+functions[_xbps_src_dest] )) || +_xbps_src_dest() { + local -a expl + if compset -P 1 '*:'; then + if [[ -z $PREFIX && $SUFFIX[1] != / ]]; then + compadd -S '' -Q -- / + else + _message -e 'dest' + fi + else + _description files expl 'src' + _xbps_full_path "$expl[@]" + fi +} + _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' + - '(mode)' \ + {-l,--list}'[List alternatives]::installed package:_xbps_packages installed' \ + {-s,--set}'[Set alternatives]:installed package:_xbps_packages installed' } _xbps_checkvers() { - _arguments -s : \ + local -i ret=1 + local -a context state state_descr line + typeset -A opt_args + local curcontext="$curcontext" + + _arguments -s -C : \ $_xbps_common \ - {-D,--distdir}'[Set the path to void-packages]:path:_files -/' \ - {-i,--installed}'[Check for outdated packages in rootdir]' \ - {-s,--show-missing}'[List any binary packages which are not built]' \ - '*:extra packages:_files' + {-D,--distdir}'[Set the path to void-packages]:path [~/void-packages]:_files -/' \ + {-e,--removed}'[List packages present in repos, but not in distdir]' \ + {-f,--format}'[Output format]: :->format' \ + {-I,--installed}'[Check for outdated packages in rootdir]' \ + {-i,--ignore-conf-repos}'[Ignore repositories defined in configuration files]' \ + {-m,--manual}'[Only process listed files]' \ + '*'{-R,--repository=-}'[Add repository to the top of the list]: :_xbps_repo_url' \ + {-s,--show-all}'[List all packages, in the format "pkgname repover srcver"]' \ + '*:extra packages:_files' && ret=0 + + case $state in + format) + local -a codes=( + '\\n:newline' + '\\t:tab' + '\\0:NULL' + '%%:a plain "%"' + '%n:package name' + '%r:package version from repositories or pkgdb (returns ? if not found)' + '%s:source package version (returns ? if not found)' + '%t:requested template name (this can be a sub package)' + '%R:repository url (returns ? if not found)' + ) + compset -P '*[^\%]' + compset -P '(%%)#' + compset -S '*' + compstate[to_end]='' + _describe -t format-codes 'format [%%n %%r %%s %%t %%R]' codes -S '' && ret=0 + ;; + esac + + return ret } _xbps_create() { - _arguments -s : \ - {-A,--architecture}'[Package architecture]:architecture:(i686 i686-musl x86_64 x86_64-musl armv7l armv7l-musl armv6l armv6l-musl aarch64 aarch64-musl ppc64le ppc64le-musl ppc64 ppc64-musl ppc ppc-musl noarch)' \ + local -i ret=1 + local -a context state state_descr line expl + typeset -A opt_args + local curcontext="$curcontext" pkgver_format='-_' + + _arguments -s -C : \ + {-A,--architecture}'[Package architecture]:architecture:_xbps_architectures -a 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: ' \ + {-C,--conflicts}"[Conflicts]:conflicts ($pkgver_format):->pkg-list" \ + {-c,--changelog}'[Changelog URL]:URL:_urls' \ + {-D,--dependencies}"[Dependencies]:dependencies ($pkgver_format):->pkg-list" \ + {-F,--config-files}'[Configuration files]:configuration files:->files-list' \ + {-G,--source-revisions}'[git revisions of the sourcepkg]:string: ' \ + {-H,--homepage}'[Homepage]:homepage:_urls' \ + '(- :)'{-h,--help}'[Show usage]' \ + {-l,--license}'[License]:license:->licenses-list' \ + {-M,--mutable-files}'[Mutable files list]:mutable files:->files-list' \ + {-m,--maintainer}'[Maintainer]:maintainer:_email_addresses' \ + {-n,--pkgver}"[Package name/version tuple]:package ($pkgver_format):->pkg-list" \ + {-P,--provides}"[Provides]:provides (-):->pkg-list" \ {-p,--preserve}'[Enable package preserve boolean]' \ {-q,--quiet}'[Work silently]' \ - {-R,--replaces}'[Replaces]:replaces: ' \ + {-R,--replaces}"[Replaces]:replaces ($pkgver_format):->pkg-list" \ + {-r,--reverts}'[Reverts]:reverts (list of _): ' \ {-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]' \ + '(- :)'{-V,--version}'[Show XBPS version]' \ + --alternatives'[List of available alternatives this pkg provides]:list of \:\::->alts-list' \ --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: ' + --compression'[Compression format]:format [zstd]:(none gzip bzip2 xz lz4 zstd)' \ + --shlib-provides'[List of provided shared libraries]:provided shared libraries:->shlib-list' \ + --shlib-requires'[List of required shared libraries]:required shared libraries:->shlib-list' \ + ':destdir:_files -/' && ret=0 + + case $state in + *-list) + # TODO: all quoting forms + # TODO: quoted spaces + # until then, don't append a space as a suffix + compset -P '* ' + compset -S ' *' + ;| + pkg-list) + _description repository-packages expl "$state_descr" + _xbps_packages "$expl[@]" -S '' repo && ret=0 + ;; + files-list) + _description files expl "$state_descr" + _files "$expl[@]" -S '' && ret=0 + ;; + shlib-list) + _wanted libraries expl "$state_descr" \ + compadd -S '' -- ${^=LD_LIBRARY_PATH:-/usr/lib /usr/local/lib}/lib*.(a|so*)(:t) && ret=0 + ;; + alts-list) + if compset -P 1 '*:*:'; then + _description files expl 'target' + _files "$expl[@]" -S '' && ret=0 + elif compset -P 1 '*:'; then + _description files expl 'symlink' + _files "$expl[@]" -S : && ret=0 + else + _wanted alternative-groups expl 'group' _xbps_alternatives_groups -S : && ret=0 + fi + ;; + licenses-list) + # List of most used licenses. Obtained like this: + # setopt extended_glob rc_quotes + # cd void-packages + # dirs=( srcpkgs/^*-devel(/) ) + # sed -nE 's/license=["''](.*)["'']/\1/p' ${^dirs}/template | + # sed 's/, /\n/g' | sort | uniq -c | sort -n + local -a licenses=( + GPL-{3,2,1}.0-{or-later,only} + LGPL-{3.0,2.1,2.0}-{or-later,only} + AGPL-3.0-{or-later,only} + MIT + BSD-{2,3,4}-Clause + Apache-2.0 + Artistic-1.0-Perl Artistic-2.0 + ISC + 'Public Domain' + CC0-1.0 CC-BY-3.0 CC-BY-SA-{4,3}.0 + Unlicense + ) + _describe -t licenses "$state_descr" licenses -S '' -l && ret=0 + ;; + esac + + return ret } _xbps_dgraph() { - _arguments : \ - {-C,--config=-}'[Full path to configuration file]:config file:_files' \ - {-c,--graph-config}'[Path to configuration file]:config file:_files' \ + _arguments -0 : \ + $_xbps_common_conf \ {-d,--debug}'[Debug mode shown to stderr]' \ - {-h,--help}'[Print help usage]' \ + '(- :)'{-h,--help}'[Show usage]' \ + {-c,--graph-config}'[Path to graph configuration file]:config file:_files' \ {-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]' \ + + '(mode)' \ + '(pkg)'{-g,--gen-config}'[Generate a graph configuration file]' \ {-f,--fulldeptree}'[Generate a dependency graph]' \ - {-m,--metadata}'[Generate a metadata graph]' \ - ':package:_xbps_all_packages' + {-m,--metadata}'[Generate a metadata graph (default mode)]' \ + + 'pkg' \ + '(mode):package:_xbps_packages_auto' +} + +_xbps_digest() { + _arguments : \ + $_xbps_common_info \ + {-m,--mode}'[Selects the digest mode]:digest mode [sha256]:(sha256)' \ + '*:file:_files' } +_xbps_fbulk() { + _arguments : \ + {-j,--jobs}'[Set number of parallel builds running at the same time]: : _guard "[0-9]#" "number of jobs [1]"' \ + {-l,--logdir}'[Set the log directory]:logdir [log.]:_files -/' \ + {-s,--system}'[System rebuild mode]' \ + {-V,--verbose}'[Enable verbose mode]' \ + '(- :)'{-v,--version}'[Show XBPS version]' \ + '(- :)'{-h,--help}'[Show usage]' \ + ':path to void-packages:_files -/' \ + '*:pkg:compadd -- $~line[1]/srcpkgs/*(:t)' +} + +_xbps_fetch() { + _arguments : \ + $_xbps_common_without_conf \ + {-o,--out}'[Rename file from specified URL to output]:output:_files' \ + {-s,--sha256}'[Print sha256sums of downloaded files]' \ + '*:URL:_urls' +} _xbps_install() { - _arguments -s : \ + _arguments -s -0 : \ $_xbps_common \ {-A,--automatic}'[Set automatic installation mode]' \ - {-c,--cachedir=-}'[Full path to cachedir]:cache dir:_files -/' \ - {-n,--dry-run}'[Dry-run mode]' \ - {-f,--force}'[Force package re-installation]' \ - {-i,--ignore-conf-repos}'[Ignore repositories defined in xbps.d]' \ + {-c,--cachedir=-}'[Full path to cachedir]:cache dir:_xbps_full_path -/' \ + {-D,--download-only}'[Only download packages to the cache]' \ + '*'{-f,--force}'[Force package re-installation]' \ + {-I,--ignore-file-conflicts}'[Ignore detected file conflicts]' \ + {-i,--ignore-conf-repos}'[Ignore repositories defined in configuration files]' \ {-M,--memory-sync}'[Keep remote repository data in memory only]' \ - '*'{-R,--repository=-}'[Add repository to the top of the list]:repository url:_files -/' \ + {-n,--dry-run}'[Dry-run mode]' \ + '*'{-R,--repository=-}'[Add repository to the top of the list]: :_xbps_repo_url' \ + --reproducible'[Enables reproducible mode in pkgdb]' \ {-S,--sync}'[Sync remote repository index]' \ - {-u,--update}'[Update target packages]' \ {-U,--unpack-only}'[Unpack packages without configuring]' \ + {-u,--update}'[Update target packages]' \ {-y,--yes}'[Assume yes to all questions]' \ - '*:available packages:_xbps_all_packages' + '*:available packages:_xbps_packages repo' } _xbps_pkgdb() { @@ -142,36 +343,50 @@ _xbps_pkgdb() { {-a,--all}'[Process all packages]' \ {-m,--mode}'[Change to this mode]:mode:(auto manual hold unhold repolock repounlock)' \ {-u,--update}'[Update pkgdb to the latest format]' \ - '*:installed packages:_xbps_installed_packages' + '*:installed packages:_xbps_packages installed' } _xbps_query() { - _arguments -s : \ + _arguments -s -0 : \ $_xbps_common \ - {-c,--cachedir=-}'[Full path to cachedir]:cache dir:_files -/' \ - {-i,--ignore-conf-repos}'[Ignore repositories defined in xbps.d]' \ + {-c,--cachedir=-}'[Full path to cachedir]:cache dir:_xbps_full_path -/' \ + {-i,--ignore-conf-repos}'[Ignore repositories defined in configuration files]' \ {-M,--memory-sync}'[Keep remote repository data in memory only]' \ - {-p,--property=-}'[Show properties]:property:($_xbps_properties)' \ + {-p,--property=-}'[Show properties]:property:_sequence _xbps_properties' \ + {-R,--repository}'[Enable repository mode]' \ + '*'--repository=-'[Add repository to the top of the list]: :_xbps_repo_url' \ --regex'[Use Extended Regular Expressions to match]' \ --fulldeptree'[Full dependency tree for -x/--deps]' \ - {-R,--repository}'[Enable repository mode]' \ - '*'--repository=-'[Add repository to the top of the list]:repository url:_files -/' \ - '(mode)' \ {-l,--list-pkgs}'[List installed packages]' \ {-L,--list-repos}'[List registered repositories]' \ {-H,--list-hold-pkgs}'[List packages on hold state]' \ + --list-repolock-pkgs'[List repolocked packages]' \ {-m,--list-manual-pkgs}'[List packages installed explicitly]' \ {-O,--list-orphans}'[List package orphans]' \ - --list-repolock-pkgs'[List packages in repolock mode]' \ {-o,--ownedby}'[Search for package files]:package file:_files' \ - {-S,--show}'[Show information]:package:_xbps_all_packages' \ + {-S,--show}'[Show information (default mode)]:package:_xbps_packages_auto' \ {-s,--search}'[Search for packages]:search string: ' \ - --cat=-'[Print file from binpkg to stdout]:file name:_files:package:_xbps_all_packages' \ - {-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' + --cat=-'[Print file from package to stdout]:file name:_xbps_package_files:package:_xbps_packages_auto' \ + {-f,--files}'[Show package files]:package:_xbps_packages_auto' \ + {-x,--deps}'[Show dependencies]:package:_xbps_packages_auto' \ + {-X,--revdeps}'[Show reverse dependencies]:package:_xbps_packages_auto' \ + - 'default' \ + ':package:_xbps_packages_auto' +} + +(( $+functions[_xbps_package_files] )) || +_xbps_package_files() { + local -a cat_args=( "${(@0)opt_args[mode---cat]}" ) files expl + if (( $#cat_args <= 1 )); then + _message 'no package specified' + return + fi + # TODO: --repository=url on the command-line + # TODO: -R on the command-line + files=( ${${(f)"$(_call_program package-files \ + xbps-query -Rf $cat_args[2] 2>/dev/null)"}% -> *} ) + _wanted package-files expl 'package file' compadd "$@" -a - files } _xbps_reconfigure() { @@ -179,105 +394,165 @@ _xbps_reconfigure() { $_xbps_common \ {-a,--all}'[Process all packages]' \ {-f,--force}'[Force reconfiguration]' \ - '*'{-i,--ignore}'[Ignore package for reconfigure]:installed packages:_xbps_installed_packages' \ - '*:installed packages:_xbps_installed_packages' + --fulldeptree'[Full dependency tree for -x/--deps]' \ + {-x,--deps}'[Also process dependencies for each package]' \ + '*'{-i,--ignore}'[Ignore package for reconfigure]:installed packages:_xbps_packages installed' \ + '*:installed packages:_xbps_packages installed' } _xbps_remove() { _arguments -s : \ $_xbps_common \ - {-c,--cachedir=-}'[Full path to cachedir]:cache dir:_files -/' \ - {-F,--force-revdeps}'[Force package removal even with revdeps/unresolved shared libraries]' \ + {-c,--cachedir=-}'[Full path to cachedir]:cache dir:_xbps_full_path -/' \ + {-F,--force-revdeps}'[Force package removal even with revdeps or unresolved shared libraries]' \ {-f,--force}'[Force package files removal]' \ - {-O,--clean-cache}'[Remove obsolete packages in cachedir]' \ - {-o,--remove-orphans}'[Remove package orphans]' \ {-n,--dry-run}'[Dry-run mode]' \ + '*'{-O,--clean-cache}'[Remove obsolete packages from the cache]' \ + {-o,--remove-orphans}'[Remove package orphans]' \ {-R,--recursive}'[Recursively remove dependencies]' \ {-y,--yes}'[Assume yes to all questions]' \ - '*:installed packages:_xbps_installed_packages' + '*:installed packages:_xbps_packages installed' } _xbps_rindex() { + local -a rest_args_spec + (( $words[(I)(-a|--add|-S|--sign-pkg)] )) && + rest_args_spec=( + 'rest' '*:packages:_files -g "*.xbps"' ) _arguments -s : \ - {-d,--debug}'[Debug mode shown to stderr]' \ + $_xbps_common_without_conf \ {-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: ' \ + {-C,--hashcheck}'[Consider file hashes for cleaning up packages]' \ + --compression'[Compression format]:format [zstd]:(none gzip bzip2 xz lz4 zstd)' \ + --privkey'[Path to the private key for signing]:private key path [˜/.ssh/id_rsa]:_files' \ + --signedby'[Signature details, i.e. "name "]:name :_email_addresses' \ - '(mode)' \ - {-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]' \ - {-S,--sign-pkg}'[Sign binary package archive]' \ - ':repository dir:_files -/' \ - '*:packages:_files' + {-a,--add}'[Add packages to repository index]:packages:_files -g "*.xbps"' \ + {-c,--clean}'[Clean repository index]:repository dir:_files -/' \ + {-r,--remove-obsoletes}'[Removes obsolete packages from repository]:repository dir:_files -/' \ + {-s,--sign}'[Sign repository index]:repository dir:_files -/' \ + {-S,--sign-pkg}'[Sign binary package archive]:packages:_files -g "*.xbps"' \ + $rest_args_spec } _xbps_uchroot() { - _arguments \ - '-D[distdir]:distdir:_files -/' \ - '-H[hostdir]:hostdir:_files -/' \ - '-S[shmdir]:shmdir:_files -/' \ - ':chroot dir:_files -/' \ - ':command: _command_names -e' \ - '*::arguments: _normal' + local -a context state state_descr line + typeset -A opt_args + _arguments -S : \ + $_xbps_common_info \ + '*'{-B,--bind-ro}'[Bind mounts src into dir/dest (read-only)]: :_xbps_src_dest' \ + '*'{-b,--bind-rw}'[Bind mounts src into dir/dest (read-write)]: :_xbps_src_dest' \ + {-O,--overlayfs}'[Creates a tempdir and mounts dir read-only via overlayfs]' \ + {-t,--tmpfs}'[Creates a tempdir and mounts dir on tmpfs (for use with -O)]' \ + {-o,--options}'[Options to be passed to the tmpfs mount (for use with -t)]:opts:->mount' \ + '*:: : _xbps_chroot_args' && return + + case $state in + mount) + words=( mount -t tmpfs -o ) + CURRENT=5 + _compskip=all + _normal -s + ;; + esac +} + +_xbps_uunshare() { + _arguments -S : \ + $_xbps_common_info + '*'{-b,--bind-rw}'[Bind mounts src into dir/dest (read-write)]: :_xbps_src_dest' \ + '*:: : _xbps_chroot_args' } _xbps_uhelper() { - local ret=1 - _arguments \ - $_xbps_common \ - '1:action:->actions' \ + local -i ret=1 + local -a context state state_descr line + typeset -A opt_args + local curcontext="$curcontext" + + _arguments : \ + $_xbps_common_conf \ + {-d,--debug}'[Debug mode shown to stderr]' \ + {-V,--version}'[Show XBPS version]' \ + ':mode:->modes' \ '*:: :->args' && ret=0 + case $state in - actions) - _values "actions" binpkgarch binpkgver cmpver digest fetch getpkgdepname \ - getpkgname getpkgrevision getpkgversion \ - pkgmatch version real-version arch getsystemdir getname getversion - ret=0;; - args) - case $words[1] in - binpkgarch) _arguments ':binpkg:' && ret=0;; - binpkgver) _arguments ':binpkg:' && ret=0;; - 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;; - getname) _arguments '*:string: ' && ret=0;; - getversion) _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;; - arch) ret=0;; - getsystemdir) ret=0;; - esac + modes) + curcontext="${curcontext%:*}:${context}" + local -a modes=( + 'arch:Prints the configured XBPS architecture' + 'binpkgarch:Prints the architecture of binpkg names' + 'binpkgver:Prints the pkgver of binpkg names' + 'cmpver:Compare two version strings' + 'getname:Prints pkgname from pkgvers or dependencies' + 'getpkgdepname:Prints pkgname from dependencies' + 'getpkgdepversion:Prints version constraint from dependencies' + 'getpkgname:Prints pkgname from pkgvers' + 'getpkgrevision:Prints revision from pkgvers' + 'getpkgversion:Prints version from pkgvers' + 'getversion:Prints version from patterns or pkgvers' + 'pkgmatch:Match pkgver against dependency' + 'real-version:Prints version of installed real packages' + 'version:Prints version of installed packages' + 'getsystemdir:Prints the system xbps.d directory' + ) + _describe -t modes "$state_descr" modes && ret=0 + ;; + args) + curcontext="${curcontext%:*:*}:xbps-uhelper-${words[1]}:${context}" + + local pkgver_format='-_' + local binpkg_format="${pkgver_format}..xbps" + local pkgpat_format='' + + case $words[1] in + binpkgarch|binpkgver) + _arguments \ + "*:binpkg ($binpkg_format): " && ret=0 ;; + cmpver) + _arguments \ + ":installed version ($pkgver_format): " \ + ":required version ($pkgver_format): " && ret=0 + ;; + getname|getpkgdepname|getpkgdepversion|getpkgname|getpkgrevision|getpkgversion|getversion) + _arguments "*:pkgver ($pkgver_format): " && ret=0 + ;; + pkgmatch) + _arguments \ + ":version ($pkgver_format): " \ + ":pattern ($pkgpat_format): " && ret=0 + ;; + real-version|version) + _arguments '*:package:_xbps_packages installed' && ret=0 + ;; + arch|getsystemdir) + _nothing && ret=0 + ;; + *) + _message "unsupported mode: $words[1]" && ret=0 + ;; + esac + ;; esac - return $ret + + return ret } _xbps() { - case "$service" in - xbps-alternatives) _xbps_alternatives "$@";; - 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 "$@";; - xbps-uunshare) _xbps_uchroot "$@";; - xbps-uhelper) _xbps_uhelper "$@";; - esac + # backward compatibility with the previous method of loading + [[ $service == xbps-* ]] || return 0 + + _compskip=all + + local -i ret=1 + if ! _call_function ret _${service//-/_} "$@"; then + _arguments -s : \ + '*: : _default' \ + -- \ + '*=*(-):url:_xbps_repo_url' && ret=0 + fi + return ret } _xbps "$@" diff --git a/data/_xbps_architectures b/data/_xbps_architectures new file mode 100644 index 00000000..c46d85dc --- /dev/null +++ b/data/_xbps_architectures @@ -0,0 +1,25 @@ +#autoload +local -a extra expl archs +zparseopts -E -D -a extra a: +# obtained from: +# cd void-packages +# print -rl -- common/cross-profiles/*.sh(:t:r) +archs=( + aarch64{,-musl} + armv5te{,-musl} + armv5tel{,-musl} + armv6hf{,-musl} + armv6l{,-musl} + armv7hf{,-musl} + armv7l{,-musl} + i686{,-musl} + mips{,el,elhf,hf}-musl + ppc{,-musl} + ppc64{,-musl} + ppc64le{,-musl} + ppcle{,-musl} + riscv64{,-musl} + x86_64{,-musl} + ${=extra[2]} +) +_wanted architectures expl 'architecture' compadd "$@" -a - archs diff --git a/data/_xbps_packages b/data/_xbps_packages new file mode 100644 index 00000000..85fe369e --- /dev/null +++ b/data/_xbps_packages @@ -0,0 +1,204 @@ +#autoload + +# Usage: _xbps_packages [$expl] (repo|installed) + +(( $+functions[_xbps_packages_repo] )) || +_xbps_packages_repo() { + local update_policy + zstyle -s ":completion:${curcontext}:" cache-policy \ + update_policy + [[ -z $update_policy ]] && + zstyle ":completion:${curcontext}:" cache-policy \ + _xbps_packages_repo_caching_policy + + if zstyle -t ":completion:${curcontext}:repository-packages" separate-sections + then + _xbps_packages_repo_separate_groups "$@" + return + fi + + local -i ret=1 + local -a packages expl qrepos repo_urls + _tags repository-packages + while _tags; do + if _requested repository-packages; then + local cache_ident='xbps_packages_repo' + (( $+opt_args[--repository] )) && + repo_urls=( ${(0)opt_args[--repository]} ) && + qrepos+=( --repository=$^repo_urls ) + (( $+opt_args[-R] )) && + repo_urls=( ${(0)opt_args[-R]} ) && + qrepos+=( --repository=$^repo_urls ) + if (( $#qrepos > 0 )) || ! _retrieve_cache $cache_ident; then + packages=( ${${${(f)"$(_call_program repository-packages \ + xbps-query $qrepos -Rs \'\' 2>/dev/null)"}#??? }%%-[^- ]# *} ) + (( $#qrepos == 0 )) && _store_cache $cache_ident packages + fi + _all_labels repository-packages expl 'package' \ + compadd "$@" -a - packages && ret=0 + fi + (( ret )) || break + done + return ret +} + +(( $+functions[_xbps_packages_repo_separate_groups] )) || +_xbps_packages_repo_separate_groups() { + local -a installed rest qrepos repo_urls lines match mbegin mend + local cache_ident='xbps_packages_repo_groups' line pkgname + (( $+opt_args[--repository] )) && + repo_urls=( ${(0)opt_args[--repository]} ) && + qrepos+=( --repository=$^repo_urls ) + (( $+opt_args[-R] )) && + repo_urls=( ${(0)opt_args[-R]} ) && + qrepos+=( --repository=$^repo_urls ) + if (( $#qrepos > 0 )) || ! _retrieve_cache $cache_ident; then + lines=( ${(f)"$(_call_program repository-packages \ + xbps-query $qrepos -Rs \'\' 2>/dev/null)"} ) + for line in $lines; do + [[ $line == (#b)\[(?)\]\ ([^ ]#)\ #* ]] || + _message "unmatched line: $line" + pkgname=${match[2]%-*} + if [[ $match[1] == '*' ]]; then + installed+=( $pkgname ) + else + rest+=( $pkgname ) + fi + done + (( $#qrepos == 0 )) && _store_cache $cache_ident installed rest + fi + + local -i ret=1 + local -a expl + _tags installed-repository-packages non-installed-repository-packages + while _tags; do + if _requested installed-repository-packages; then + _all_labels installed-repository-packages expl 'installed repository packages' \ + compadd -a installed && ret=0 + fi + if _requested non-installed-repository-packages; then + _all_labels non-installed-repository-packages expl 'non-installed repository packages' \ + compadd -a rest && ret=0 + fi + (( ret )) || break + done + return ret +} + +(( $+functions[_xbps_packages_installed] )) || +_xbps_packages_installed() { + local update_policy + zstyle -s ":completion:${curcontext}:" cache-policy \ + update_policy + [[ -z $update_policy ]] && + zstyle ":completion:${curcontext}:" cache-policy \ + _xbps_packages_installed_caching_policy + + if zstyle -t ":completion:${curcontext}:installed-packages" separate-sections && + { zstyle -t ":completion:${curcontext}:installed-packages" use-cache || + zstyle -t ":completion:${curcontext}:installed-packages" extra-verbose } + then + _xbps_packages_installed_separate_groups "$@" + return + fi + + local -i ret=1 + local -a installed expl + _tags installed-packages + while _tags; do + if _requested installed-packages; then + local cache_ident='xbps_packages_installed' + if ! _retrieve_cache $cache_ident; then + installed=( ${${${(f)"$(_call_program installed-packages \ + xbps-query -l 2>/dev/null)"}#?? }%%-[^- ]# *} ) + _store_cache $cache_ident installed + fi + _all_labels installed-packages expl 'package' \ + compadd "$@" -a - installed && ret=0 + fi + (( ret )) || break + done + return ret +} + +(( $+functions[_xbps_packages_installed_separate_groups] )) || +_xbps_packages_installed_separate_groups() { + local -a installed manual orphans rest + local cache_ident='xbps_packages_installed_groups' + if ! _retrieve_cache $cache_ident; then + installed=( ${${${(f)"$(_call_program installed-packages \ + xbps-query -l 2>/dev/null)"}#?? }%%-[^- ]# *} ) + manual=( ${${(f)"$(_call_program manual-installed-packages \ + xbps-query -m 2>/dev/null)"}%%-[^- ]#} ) + orphans=( ${${(f)"$(_call_program orphaned-installed-packages \ + xbps-query -O 2>/dev/null)"}%%-[^- ]#} ) + rest=( ${${installed:|manual}:|orphans} ) + _store_cache $cache_ident manual orphans rest + fi + + local -i ret=1 + local -a expl + _tags manual-installed-packages \ + orphaned-installed-packages \ + rest-installed-packages + while _tags; do + if _requested manual-installed-packages; then + _all_labels manual-installed-packages expl 'explicitly installed packages' \ + compadd -a manual && ret=0 + fi + if _requested orphaned-installed-packages; then + _all_labels orphaned-installed-packages expl 'orphans' \ + compadd -a orphans && ret=0 + fi + if _requested rest-installed-packages; then + _all_labels rest-installed-packages expl 'rest installed packages' \ + compadd -a rest && ret=0 + fi + (( ret )) || break + done + return ret +} + +_xbps_packages() { + local cmd="$@[-1]" + shift -p + + [[ $cmd == (repo|installed) ]] || { + _message "unsupported command: $cmd" + return 1 + } + + _xbps_packages_$cmd "$@" +} + +_xbps_packages_repo_caching_policy() { + # rebuild if cache is absent or more than a week old + local -a oldp + oldp=( $1(Nmw+1) ) + (( $#oldp )) && return 0 + + local -a repos_data=( /var/db/xbps/^triggers/*(N.) ) + local -a loc_configs=( /etc/xbps.d(N-/) /etc/xbps.d/*.conf(N) ) + local -a sys_configs=( /usr/share/xbps.d(N-/) /usr/share/xbps.d/*.conf(N) ) + + (( $#repos_data == 0 || $#loc_configs == 0 || $#sys_configs == 0 )) && + return 0 + + local f + for f in $repos_data $loc_configs $sys_configs; do + [[ $f -nt $1 ]] && return 0 + done + + return 1 +} + +_xbps_packages_installed_caching_policy() { + # rebuild if cache is absent or more than a week old + local -a oldp + oldp=( $1(Nmw+1) ) + (( $#oldp )) && return 0 + + [[ /var/db/xbps/pkgdb-0.38.plist -nt $1 ]] +} + +_xbps_packages "$@" diff --git a/data/_xbps_properties b/data/_xbps_properties new file mode 100644 index 00000000..f6c43e0c --- /dev/null +++ b/data/_xbps_properties @@ -0,0 +1,40 @@ +#autoload +# man 1 xbps-query +local -a props=( + 'alternatives:group and file alternatives provided by the package' + 'architecture:target architecture the package was build for' + 'automatic-install:returns "yes" if the package was installed automatically' + 'build-options:enabled options the package was built with' + 'changelog:changelog URL for the package' + 'conf_files:configuration file(s) installed by the package' + 'conflicts:other packages this package conflicts with' + 'filename-sha256:hash of the package file' + 'filename-size:size of the package file' + 'hold:returns "yes" if the package is held and will not be updated' + 'homepage:home URL of the package project' + 'install-date:date when the package was installed' + 'install-msg:post-install message provided by the package' + 'install-script:script used for installing the package' + 'installed_size:total size of files installed by the package' + 'license:license(s) for distributing the package' + 'maintainer:contact of the maintainer of the package' + 'metafile-sha256:hash of the plist package files metadata' + 'pkgname:name of the package' + 'pkgver:version of the package' + 'preserve:returns "yes" if the package will not be removed automatically on update' + 'provides:abstract facility provided by the package' + 'remove-msg:post-remove message provided by the package' + 'remove-script:script used for removing the package' + 'replaces:other packages that the package replaces' + 'repolock:returns "yes" if the package only accepts updates from original repository' + 'repository:repository where the package was installed from' + 'reverts:previous provided version this package replaces' + 'run_depends:other runtime dependency packages for the package' + 'shlib-provides:shared libraries provided by the package' + 'shlib-requires:shared libraries required by the package' + 'short_desc:short description of the package' + 'source-revisions:commit hash of package last change from the void-packages repository' + 'state:installation state of the package' + 'tags:list of categories the package is associated with' +) +_describe -t properties 'property' props "$@" diff --git a/data/_xbps_src b/data/_xbps_src index 43b5f704..735c0549 100644 --- a/data/_xbps_src +++ b/data/_xbps_src @@ -1,79 +1,200 @@ #compdef xbps-src -setopt localoptions extended_glob - -local ret=0 archs top - -archs=(aarch64-musl aarch64 armv5te-musl armv5te armv5tel-musl armv5tel armv6hf-musl armv6hf armv6l-musl armv6l armv7hf-musl armv7hf armv7l-musl armv7l i686-musl i686 mips-musl mipsel-musl mipselhf-musl mipshf-musl ppc-musl ppc ppc64-musl ppc64 ppc64le-musl ppc64le x86_64-musl) - -# path to masterdir and srcpkgs. -top=$~_comp_command1:h - +(( $+functions[_xbps_src_all_packages] )) || _xbps_src_all_packages() { - compadd "$@" -- $top/srcpkgs/*(:t) + local -a expl + _wanted all-packages expl 'all packages' \ + compadd "$@" - $top/srcpkgs/*(:t) } +(( $+functions[_xbps_src_destdir_packages] )) || _xbps_src_destdir_packages() { - local -a dirs + local -a dirs expl dirs=( $top/masterdir/destdir/*~[^-]#-linux-[^-]#(N/) ) - compadd "$@" -- ${${dirs:t}%-*} + _wanted destdir-packages expl 'destdir packages' \ + compadd "$@" - ${${dirs:t}%-*} } +(( $+functions[_xbps_src_build_packages] )) || _xbps_src_build_packages() { - local -a dirs + local -a dirs expl dirs=( $top/masterdir/builddir/*~[^-]#-linux-[^-]#(N/) ) - compadd "$@" -- ${${dirs:t}%-*} + _wanted build-packages expl 'build packages' \ + compadd "$@" - ${${dirs:t}%-*} } -_arguments -s : \ - '-a[Cross compile packages]:architecture:($archs)' \ - '-C[Do not remove build directory/autodeps/destdir]' \ - '-E[Exit immediately when binary package already exists]' \ - '-f[Force building and registering binary packages]' \ - '-G[Enable XBPS_USE_GIT_REVS]' \ - '-Q[Enable running the check stage]' \ - '-g[Enable building -dbg packages]' \ - '-H[Absolute path to hostdir]:hostdir:_files -/' \ - '-h[Help]' \ - '-I[Ignore required dependencies]' \ - '-j[Number of parallel build jobs]:number: ' \ - '-L[Disable ASCII colors]' \ - '-m[Absolute path to masterdir]:masterdir:_files -/' \ - '-N[Disable use of remote repositories]' \ - '-o[Set package build options]:options: ' \ - '-q[Suppress output of xbps-src]' \ - '-r[Use alternative local repository]:repo:_files -/' \ - '-t[Create a temporary masterdir]' \ - '1:target:->target' \ - '*::args:->args' && ret=0 +_xbps_src() { + # path to masterdir and srcpkgs. + local top=$~_comp_command1:h + + local -i ret=1 + local -a context state state_descr line expl + typeset -A opt_args + local curcontext="$curcontext" + + _arguments -s -C : \ + '-1[Fail if dependencies are missing]' \ + '-A[Host architecture]:architecture:_xbps_architectures' \ + '-a[Cross compile packages]:architecture:_xbps_architectures' \ + '-b[Build broken, nocross, and excluded packages]' \ + '-c[Configuration file]:config:->config' \ + '-C[Do not remove build directory/autodeps/destdir]' \ + '-E[Exit immediately when binary package already exists]' \ + '-f[Force building and registering binary packages]' \ + '-G[Enable XBPS_USE_GIT_REVS]' \ + '-g[Enable building -dbg packages]' \ + '-H[Absolute path to hostdir]:hostdir [void-packages/hostdir]:_xbps_full_path -/' \ + '(- :)-h[Help]' \ + '-I[Ignore required dependencies]' \ + '-i[Make internal errors non-fatal]' \ + '-j[Number of parallel build jobs]: : _guard "[0-9]#" "number of jobs"' \ + '-L[Disable ASCII colors]' \ + '-m[Absolute path to masterdir]:masterdir [void-packages/masterdir-]:_xbps_full_path -/' \ + '-N[Disable use of remote repositories]' \ + '-o[Set package build options]:opt,~opt2,...: ' \ + '-p[Show additional variables]:variables:->vars' \ + '-Q[Enable running the check stage]' \ + '-K[Enable extended checks]' \ + '-q[Suppress output of xbps-src]' \ + '-r[Use alternative local repository]:repo [hostdir/binpkgs]:->repo' \ + '-s[Make some warnings errors]' \ + '-t[Create a temporary masterdir]' \ + '-v[Show verbose messages]' \ + '(- :)-V[Print version]' \ + '1:target:->target' \ + '*:: :->args' && ret=0 -case $state in + case $state in + config) + _wanted configs expl "$state_descr" \ + _path_files -W $top/etc -g 'conf.*(-.:e)' && ret=0 + ;; + repo) + local hostdir=$top/hostdir + (( $+opt_args[-H] )) && hostdir=$opt_args[-H] + _wanted local-repositories expl "$state_descr" \ + _files -/ -W $hostdir/binpkgs && ret=0 + ;; + vars) + # sed -nE '/^#### Mandatory variables/,/^#### About the many types/{s/^- `([^`]+)`.*/\1/p;}' Manual.md + local -a vars=( + # mandatory + homepage maintainer pkgname revision short_desc version + # optional + hostmakedepends makedepends checkdepends depends bootstrap conflicts + distfiles checksum wrksrc build_wrksrc create_wrksrc build_style + build_helper configure_script configure_args make_cmd make_build_args + make_check_args make_install_args make_build_target make_check_target + make_install_target make_check_pre patch_args disable_parallel_build + disable_parallel_check make_check keep_libtool_archives skip_extraction + nodebug conf_files mutable_files make_dirs repository nostrip + nostrip_files noshlibprovides noverifyrdeps skiprdeps ignore_elf_files + ignore_elf_dirs nocross restricted subpackages broken shlib_provides + shlib_requires nopie nopie_files reverts alternatives font_dirs + dkms_modules register_shell tags perl_configure_dirs preserve fetch_cmd + changelog archs nocheckperms nofixperms + ) + _wanted variables expl "$state_descr" _sequence compadd -a - vars && ret=0 + ;; target) - _values "target" binary-bootstrap bootstrap bootstrap-update \ - build check chroot clean clean-repocache configure \ - consistency-check extract fetch install \ - list patch pkg purge-distfiles remove remove-autodeps \ - show show-avail show-build-deps \ - show-deps show-hostmakedepends show-makedepends \ - show-files show-options show-shlib-provides \ - show-shlib-requires show-var show-repo-updates \ - show-sys-updates sort-dependencies update-bulk update-check \ - update-sys update-hash-cache zap - ret=0;; + local -a targets=( + 'binary-bootstrap:Install bootstrap packages from host repositories into ' + 'bootstrap-update:Updates bootstrap packages' + 'bootstrap:Build and install from source the bootstrap packages into ' + 'build:Build package source (fetch + extract + patch + configure + build)' + 'check:Run the package check(s) after building the package source' + 'chroot:Enter to the chroot in ' + 'clean-repocache:Removes obsolete packages from /repocache' + 'clean:Removes auto dependencies, cleans up /builddir and /destdir' + 'configure:Configure a package (fetch + extract + patch + configure)' + 'consistency-check:Runs a consistency check on all packages' + 'extract:Extract package source distribution file(s) into the build directory [/builddir]' + 'fetch:Download package source distribution file(s)' + 'install:Install target package into ; skip building' + 'list:Lists installed packages in ' + 'patch:Patch the package sources' + 'pkg:Build binary package and all required dependencies' + 'purge-distfiles:Removes all obsolete distfiles in /sources' + 'remove-autodeps:Removes all package dependencies that were installed automatically' + 'remove:Remove target package from ' + 'show-avail:Returns 0 if package can be built for the given architecture' + 'show-build-deps:Show required build dependencies' + 'show-deps:Show required run-time dependencies' + 'show-files:Show files installed by a package' + 'show-hostmakedepends:Show required host build dependencies' + 'show-local-updates:Prints the list of outdated packages in your local repositories' + 'show-makedepends:Show required target build dependencies' + 'show-options:Show available build options' + 'show-repo-updates:Prints the list of outdated packages in XBPS repositories' + 'show-shlib-provides:Show list of provided shlibs' + 'show-shlib-requires:Show list of required shlibs' + 'show-sys-updates:Prints the list of outdated packages in your system' + "show-var:Prints the value of a variable, if it's defined in xbps-src" + 'show:Show information for the specified package' + 'sort-dependencies:Sorts dependencies of packages' + 'update-bulk:Rebuilds all packages in the system repositories that are outdated' + 'update-check:Check upstream site for new releases' + 'update-hash-cache:Update the hash cache with existing source distfiles' + 'update-local:Rebuilds all packages in your local repositories that are outdated' + 'update-sys:Rebuilds all packages in your system that are outdated and updates them' + 'zap:Removes a masterdir but preserving ccache, distcc and host directories' + ) + _describe -t targets "$state_descr" targets && ret=0 + ;; args) - case $words[1] in - build|check|configure|extract|fetch|install|patch|pkg|show|show-avail|show-build-deps|show-hostmakedepends|show-makedepends|show-options|update-check) - _arguments ':package:_xbps_src_all_packages' && ret=0;; - binary-bootstrap) - _arguments '::architecture:($archs)' && ret=0;; - bootstrap|bootstrap-update|chroot|clean-repocache|consistency-check|list|purge-distfiles|remove-autodeps|show-repo-updates|show-sys-updates|update-bulk|update-sys|update-hash-cache) - # no further arguments - ret=0;; - clean) - _arguments '::package:_xbps_src_build_packages' && ret=0;; - remove|show-deps|show-files|show-shlib-provides|show-shlib-requires) - _arguments ':package:_xbps_src_destdir_packages' && ret=0;; - esac;; -esac + curcontext="${curcontext%:*:*}:xbps-src-${words[1]}:" + + local -a pkgname_targets=( + build check configure extract fetch install patch pkg show show-avail + show-build-deps show-hostmakedepends show-makedepends show-options + update-check + ) + local -a no_args_targets=( + binary-bootstrap bootstrap bootstrap-update chroot clean-repocache + consistency-check list purge-distfiles remove-autodeps show-local-updates + show-repo-updates show-sys-updates update-bulk update-local update-sys + update-hash-cache zap + ) + local -a destdir_targets=( + remove show-deps show-files show-shlib-provides show-shlib-requires + ) + local target=$words[1] + if (( $pkgname_targets[(I)$target] )); then + _arguments ':package:_xbps_src_all_packages' && ret=0 + elif (( $no_args_targets[(I)$target] )); then + _nothing && ret=0 + elif [[ $target == clean ]]; then + _arguments '::package:_xbps_src_build_packages' && ret=0 + elif (( $destdir_targets[(I)$target] )); then + _arguments ':package:_xbps_src_destdir_packages' && ret=0 + elif [[ $target == sort-dependencies ]]; then + _arguments '*:package:_xbps_src_all_packages' && ret=0 + elif [[ $target == show-var ]]; then + # obtained by comparing the output of `env -i bash -c 'compgen -v'` with + # and without the source code for the show-var target being applied + local -a vars=( + CPAN_SITE DEBIAN_SITE FREEDESKTOP_SITE GNOME_SITE GNU_SITE KDE_SITE + KERNEL_SITE MOZILLA_SITE NONGNU_SITE PYPI_SITE SOURCEFORGE_SITE + UBUNTU_SITE VIDEOLAN_SITE XORG_SITE + + bash_regexp perl_regexp py2_inc py2_lib py2_sitelib py2_ver py3_abiver + py3_inc py3_lib py3_sitelib py3_ver python_regexp + + XBPS_CFLAGS XBPS_CROSS_CFLAGS XBPS_CROSS_CXXFLAGS XBPS_CROSS_FFLAGS + XBPS_CROSS_RUSTFLAGS XBPS_CROSS_RUST_TARGET XBPS_CROSS_TRIPLET + XBPS_CROSS_ZIG_CPU XBPS_CROSS_ZIG_TARGET XBPS_CXXFLAGS XBPS_FFLAGS + XBPS_RUST_TARGET XBPS_TARGET_CFLAGS XBPS_TARGET_CXXFLAGS + XBPS_TARGET_FFLAGS XBPS_TARGET_MACHINE XBPS_TARGET_QEMU_MACHINE + XBPS_TRIPLET XBPS_ZIG_CPU XBPS_ZIG_TARGET + ) + _arguments ":var:($vars)" && ret=0 + else + _message "unsupported target: $target" && ret=0 + fi + ;; + esac + + return ret +} -return $ret +_xbps_src "$@"