File tree Expand file tree Collapse file tree 3 files changed +36
-13
lines changed Expand file tree Collapse file tree 3 files changed +36
-13
lines changed Original file line number Diff line number Diff line change 1
1
_ebuildtester() {
2
- local cur prev opts
2
+ local cur prev opts prefix
3
3
COMPREPLY=()
4
4
cur="${COMP_WORDS[COMP_CWORD]}"
5
5
prev="${COMP_WORDS[COMP_CWORD-1]}"
@@ -27,22 +27,31 @@ _ebuildtester() {
27
27
--with-X
28
28
--with-vnc
29
29
--profile
30
+ --features
30
31
--docker-image
31
32
--docker-command
32
33
--pull
33
34
--show-options
34
35
)
35
36
36
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
37
- COMPREPLY=( $(compgen -W "${opts[*]}" -- ${cur}) )
38
- return 0
39
- fi
40
-
41
37
case "${prev}" in
42
38
--portage-dir|--overlay-dir)
43
39
COMPREPLY=( $(compgen -o dirnames -A directory ${cur}) )
44
40
;;
41
+ --features)
42
+ if [[ ${cur} =~ ^- ]]; then
43
+ prefix=("-P" "-")
44
+ else
45
+ prefix=()
46
+ fi
47
+ echo
48
+ COMPREPLY=( $(compgen ${prefix[@]} -W "ccache sandbox userfetch" -- ${cur#-}) )
49
+ ;;
45
50
esac
46
51
52
+ if [[ ( ${cur} =~ ^-.* && ${prev} != --features ) || ${COMP_CWORD} -eq 1 ]] ; then
53
+ COMPREPLY=( $(compgen -W "${opts[*]}" -- ${cur}) )
54
+ return 0
55
+ fi
47
56
}
48
57
complete -F _ebuildtester ebuildtester
Original file line number Diff line number Diff line change @@ -202,15 +202,11 @@ def _tweak_settings(self):
202
202
203
203
options .log .info ("tweaking portage settings" )
204
204
205
- features = "-sandbox -usersandbox"
206
-
207
- if options .options .binhost :
208
- features += " getbinpkg"
209
-
210
205
# Disable the usersandbox feature, it's not working well inside a
211
206
# docker container.
212
- self .execute ("echo FEATURES=\\ \" {}\\ \" "
213
- ">> /etc/portage/make.conf" .format (features ))
207
+ self .execute (
208
+ f"echo FEATURES=\\ \" { ' ' .join (options .options .features )} \\ \" "
209
+ ">> /etc/portage/make.conf" )
214
210
215
211
self .execute (("echo MAKEOPTS=\\ \" -j%d\\ \" " %
216
212
(options .options .threads )) +
Original file line number Diff line number Diff line change @@ -108,6 +108,13 @@ def parse_commandline(args):
108
108
"--profile" ,
109
109
help = "The profile to use (default = %(default)s)" ,
110
110
default = "default/linux/amd64/17.1" )
111
+ parser .add_argument (
112
+ '--features' ,
113
+ help = "Set FEATURES, see https://wiki.gentoo.org/wiki/FEATURES "
114
+ "(default = %(default)s)" ,
115
+ default = ["-sandbox" , "-usersandbox" , "userfetch" ],
116
+ nargs = "+" ,
117
+ action = "append" )
111
118
parser .add_argument (
112
119
"--docker-image" ,
113
120
help = "Specify the docker image to use (default = %(default)s)" ,
@@ -142,6 +149,17 @@ def parse_commandline(args):
142
149
else :
143
150
options .atom = []
144
151
152
+ temp = []
153
+ for feature in options .features :
154
+ if type (feature ) is list :
155
+ temp += feature
156
+ else :
157
+ temp .append (feature )
158
+ options .features = temp
159
+
160
+ if options .binhost :
161
+ options .features .append ("getbinpkg" )
162
+
145
163
if options .with_vnc :
146
164
options .atom += ["net-misc/tigervnc" , "x11-wm/icewm" ]
147
165
You can’t perform that action at this time.
0 commit comments