@@ -8,10 +8,39 @@ _poudriere_pt() {
8
8
_values "poudriere portstrees" ${${(f)"$(${service} ports -lq)"}%% *}
9
9
}
10
10
11
+ _poudriere_direct_port() {
12
+ # Find a ports tree to complete ports
13
+ local prev_word=
14
+ local ports_tree=
15
+ local w
16
+
17
+ # Determine whether a tree has already been specified with -p
18
+ for w in ${words[@]}; do
19
+ if [[ $w == -p ]]; then
20
+ prev_word=-p
21
+ elif [[ $prev_word == -p ]]; then
22
+ ports_tree="$w"
23
+ break
24
+ fi
25
+ done
26
+
27
+ # Determine whether the default tree is present
28
+ if [[ -z $ports_tree ]] && poudriere ports -l | grep -q '^default '; then
29
+ ports_tree=default
30
+ elif [[ -z $ports_tree ]]; then
31
+ return
32
+ fi
33
+
34
+ local ports_tree_path="$(poudriere ports -lq | awk -v tree=$ports_tree '{if (match($1, tree)) {print $5}}')"
35
+
36
+ # complete port
37
+ _path_files -W ${ports_tree_path} -/
38
+ }
39
+
11
40
_bulk=(
12
- '-a[build the whole ports tree]'
13
- '-f [get the list of ports to build from a file]:name of file:_files'
14
- '-B[what buildname to use]:buildname'
41
+ '(-f *) -a[build the whole ports tree]'
42
+ '(-a *)-f+ [get the list of ports to build from a file]:name of file:_files'
43
+ '-B+ [what buildname to use]:buildname'
15
44
'-c[clean all the previously built binary packages and logs]'
16
45
'-C[clean only the packages listed on the command line or -f file]'
17
46
'-i[interactive mode. enter jail for interactive testing and automatically cleanup when done]'
@@ -25,12 +54,13 @@ _bulk=(
25
54
'-F[only fetch from original master_site (skip FreeBSD mirrors)]'
26
55
'-S[don\x27t recursively rebuild packages affected by other packages requiring incremental rebuild]'
27
56
'-J[run n jobs in parallel, and optionally run a different number of jobs in parallel while preparing the build]::'
28
- '-j[run only on the given jail]: :jail name:_poudriere_jail'
57
+ '-j+ [run only on the given jail]:jail name:_poudriere_jail'
29
58
'-N[do not build package repository or INDEX when build completed]'
30
- '-p[specify on which ports tree the bulk build will be done]: :tree:_poudriere_pt'
59
+ '-p+ [specify on which ports tree the bulk build will be done]:tree:_poudriere_pt'
31
60
'-v[be verbose; show more information. Use twice to enable debug output]'
32
61
'-w[save WRKDIR on failed builds]'
33
- '-z[specify which SET to use]::'
62
+ '-z+[specify which SET to use]:'
63
+ '(-a -f)*:cat/port:_poudriere_direct_port'
34
64
)
35
65
36
66
_daemon=(
@@ -107,16 +137,17 @@ _logclean=(
107
137
)
108
138
109
139
_options=(
110
- '-a[indicates the TARGET_ARCH if no jail is specified]::arch:(amd64 i386)'
140
+ '-a+ [indicates the TARGET_ARCH if no jail is specified]::arch:(amd64 i386)'
111
141
"(-C)-c[use 'make config' target]::"
112
142
"(-c)-C[use 'make config-conditional' target]::"
113
- '-f [give the list of ports to set options]:name of file:_files'
114
- '-j[run on the given jail]: :name:_poudriere_jail'
143
+ '(*)-f+ [give the list of ports to set options]:name of file:_files'
144
+ '-j+ [run on the given jail]:name:_poudriere_jail'
115
145
'-n[do not configure/show/remove options of dependencies]::'
116
- '-p[specify on which ports tree the configuration will be done]::tree:_poudriere_pt'
146
+ '-p+ [specify on which ports tree the configuration will be done]::tree:_poudriere_pt'
117
147
'(-r)-s[show options instead of configuring them]::'
118
148
'(-s)-r[show port options instead of configuring them]::'
119
- '-z[Specify which SET to use]::'
149
+ '-z+[Specify which SET to use]:'
150
+ '(-f)*:cat/port:_poudriere_direct_port'
120
151
)
121
152
122
153
_pkgclean=(
@@ -167,21 +198,23 @@ _status=(
167
198
)
168
199
169
200
_testport=(
170
- '-j[run inside the given jail]::name:_poudriere_jail'
171
- '-B[What buildname to use]::'
201
+ '-j+[run inside the given jail]:name:_poudriere_jail'
202
+ '-o+[Specify an origin in the portstree]:origin:_poudriere_direct_port'
203
+ '-B+[What buildname to use]:'
172
204
'-c[run make config for the given port]::'
173
205
'-i[interactive mode]'
174
206
'-I[advanced interactive mode]'
175
- '-J[Run n jobs in parallel for dependencies, and optionally run a different number of jobs in parallel while preparing the build]:: '
207
+ '-J[Run n jobs in parallel for dependencies, and optionally run a different number of jobs in parallel while preparing the build]:'
176
208
"-k[don't consider failures as fatal; find all failures]"
177
209
'-n[show what will be done, but do not build any packages]'
178
210
'-N[do not build package repository when build of dependencies completed]'
179
- '-p[specifies which ports tree to use]::tree:_poudriere_pt'
180
- '-P[use custom prefix]'
181
211
"-S[don't recursively rebuild packages affected by other packages requiring incremental rebuild]"
212
+ '-p+[specifies which ports tree to use]::tree:_poudriere_pt'
213
+ '-P[use custom prefix]'
182
214
'-v[be verbose; show more information]'
183
215
'-w[save WRKDIR on failed builds]'
184
- '-z[specify which SET to use]::'
216
+ '-z+[specify which SET to use]::'
217
+ '*:cat/port:_poudriere_direct_port'
185
218
)
186
219
187
220
_poudriere () {
0 commit comments