2014-07-22 21:20:58 +05:30
|
|
|
#compdef xbps-src
|
|
|
|
|
|
|
|
setopt localoptions extended_glob
|
|
|
|
|
|
|
|
local ret=0 archs top
|
|
|
|
|
2019-05-01 08:52:55 +05:30
|
|
|
archs=(aarch64-musl aarch64 armv6hf-musl armv6hf armv7hf-musl armv7hf i686-musl i686 mips mipsel ppc-musl ppc ppc64le-musl ppc64le ppc64-musl ppc64 x86_64-musl)
|
2014-07-22 21:20:58 +05:30
|
|
|
|
|
|
|
# path to masterdir and srcpkgs.
|
|
|
|
top=$~_comp_command1:h
|
|
|
|
|
|
|
|
_xbps_src_all_packages() {
|
|
|
|
compadd "$@" -- $top/srcpkgs/*(:t)
|
|
|
|
}
|
|
|
|
|
|
|
|
_xbps_src_destdir_packages() {
|
|
|
|
local -a dirs
|
|
|
|
dirs=( $top/masterdir/destdir/*~[^-]#-linux-[^-]#(N/) )
|
|
|
|
compadd "$@" -- ${${dirs:t}%-*}
|
|
|
|
}
|
|
|
|
|
|
|
|
_xbps_src_build_packages() {
|
|
|
|
local -a dirs
|
|
|
|
dirs=( $top/masterdir/builddir/*~[^-]#-linux-[^-]#(N/) )
|
|
|
|
compadd "$@" -- ${${dirs:t}%-*}
|
|
|
|
}
|
|
|
|
|
|
|
|
_arguments -s : \
|
|
|
|
'-a[Cross compile packages]:architecture:($archs)' \
|
|
|
|
'-C[Do not remove build directory/autodeps/destdir]' \
|
2015-03-07 18:35:36 +05:30
|
|
|
'-E[Exit immediately when binary package already exists]' \
|
2014-07-22 21:20:58 +05:30
|
|
|
'-f[Force building and registering binary packages]' \
|
|
|
|
'-G[Enable XBPS_USE_GIT_REVS]' \
|
2019-07-17 01:07:18 +05:30
|
|
|
'-Q[Enable running the check stage]' \
|
2014-07-22 21:20:58 +05:30
|
|
|
'-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: ' \
|
2020-03-10 16:16:27 +05:30
|
|
|
'-q[Suppress output of xbps-src]' \
|
2014-07-22 21:20:58 +05:30
|
|
|
'-r[Use alternative local repository]:repo:_files -/' \
|
2015-03-07 18:35:36 +05:30
|
|
|
'-t[Create a temporary masterdir]' \
|
2014-07-22 21:20:58 +05:30
|
|
|
'1:target:->target' \
|
|
|
|
'*::args:->args' && ret=0
|
|
|
|
|
|
|
|
case $state in
|
|
|
|
target)
|
|
|
|
_values "target" binary-bootstrap bootstrap bootstrap-update \
|
2019-07-18 18:14:57 +05:30
|
|
|
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 \
|
2014-07-22 21:20:58 +05:30
|
|
|
show-shlib-requires show-var show-repo-updates \
|
2019-07-18 18:14:57 +05:30
|
|
|
show-sys-updates update-bulk update-check update-sys \
|
|
|
|
update-hash-cache zap
|
2014-07-22 21:20:58 +05:30
|
|
|
ret=0;;
|
|
|
|
args)
|
|
|
|
case $words[1] in
|
2019-07-18 18:14:57 +05:30
|
|
|
build|check|configure|extract|fetch|install|patch|pkg|show|show-avail|show-build-deps|show-hostmakedepends|show-makedepends|show-options|update-check)
|
2014-07-22 21:20:58 +05:30
|
|
|
_arguments ':package:_xbps_src_all_packages' && ret=0;;
|
|
|
|
binary-bootstrap)
|
|
|
|
_arguments '::architecture:($archs)' && ret=0;;
|
2019-07-18 18:14:57 +05:30
|
|
|
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)
|
2014-07-22 21:20:58 +05:30
|
|
|
# no further arguments
|
|
|
|
ret=0;;
|
|
|
|
clean)
|
|
|
|
_arguments '::package:_xbps_src_build_packages' && ret=0;;
|
2019-07-18 18:14:57 +05:30
|
|
|
remove|show-deps|show-files|show-shlib-provides|show-shlib-requires)
|
2014-07-22 21:20:58 +05:30
|
|
|
_arguments ':package:_xbps_src_destdir_packages' && ret=0;;
|
|
|
|
esac;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
return $ret
|