-
Notifications
You must be signed in to change notification settings - Fork 125
/
Copy path_xbps_src
87 lines (77 loc) · 3.21 KB
/
_xbps_src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#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
_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 : \
'-1[Fail if dependencies are missing]' \
'-A[Host architecture]:architecture:($archs)' \
'-a[Cross compile packages]:architecture:($archs)' \
'-b[Build broken, nocross, and excluded packages]' \
'-c[Configuration file]: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:_files -/' \
'-h[Help]' \
'-I[Ignore required dependencies]' \
'-i[Make internal errors non-fatal]' \
'-j[Number of parallel build jobs]:number: ' \
'-K[Enable extended checks]' \
'-L[Disable ASCII colors]' \
'-m[Absolute path to masterdir]:masterdir:_files -/' \
'-N[Disable use of remote repositories]' \
'-p[Show additional variables]:variables: ' \
'-o[Set package build options]:options: ' \
'-Q[Enable running the check stage]' \
'-q[Suppress output of xbps-src]' \
'-r[Use alternative local repository]:repo:_files -/' \
'-s[Make some warnings errors]' \
'-t[Create a temporary masterdir]' \
'-v[Show verbose messages]' \
'-V[Print version]' \
'1:target:->target' \
'*::args:->args' && ret=0
case $state in
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;;
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|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
return $ret