56
56
- Only install dependencies.
57
57
type: bool
58
58
default: false
59
+ install_recommendations:
60
+ description:
61
+ - If V(true), installs dependencies declared as recommends per META spec.
62
+ - If V(false), it ensures the dependencies declared as recommends are not installed, overriding any decision made earlier in E(PERL_CPANM_OPT).
63
+ - If parameter is not set, C(cpanm) will use its existing defaults.
64
+ - When these dependencies fail to install, cpanm continues the installation, since they are just recommendation.
65
+ type: bool
66
+ version_added: 10.3.0
67
+ install_suggestions:
68
+ description:
69
+ - If V(true), installs dependencies declared as suggests per META spec.
70
+ - If V(false), it ensures the dependencies declared as suggests are not installed, overriding any decision made earlier in E(PERL_CPANM_OPT).
71
+ - If parameter is not set, C(cpanm) will use its existing defaults.
72
+ - When these dependencies fail to install, cpanm continues the installation, since they are just suggestion.
73
+ type: bool
74
+ version_added: 10.3.0
59
75
version:
60
76
description:
61
77
- Version specification for the perl module. When O(mode) is V(new), C(cpanm) version operators are accepted.
@@ -167,6 +183,8 @@ class CPANMinus(ModuleHelper):
167
183
mirror = dict (type = 'str' ),
168
184
mirror_only = dict (type = 'bool' , default = False ),
169
185
installdeps = dict (type = 'bool' , default = False ),
186
+ install_recommendations = dict (type = 'bool' ),
187
+ install_suggestions = dict (type = 'bool' ),
170
188
executable = dict (type = 'path' ),
171
189
mode = dict (type = 'str' , default = 'new' , choices = ['compatibility' , 'new' ]),
172
190
name_check = dict (type = 'str' )
@@ -181,6 +199,8 @@ class CPANMinus(ModuleHelper):
181
199
mirror = cmd_runner_fmt .as_opt_val ('--mirror' ),
182
200
mirror_only = cmd_runner_fmt .as_bool ("--mirror-only" ),
183
201
installdeps = cmd_runner_fmt .as_bool ("--installdeps" ),
202
+ install_recommendations = cmd_runner_fmt .as_bool ("--with-recommends" , "--without-recommends" , ignore_none = True ),
203
+ install_suggestions = cmd_runner_fmt .as_bool ("--with-suggests" , "--without-suggests" , ignore_none = True ),
184
204
pkg_spec = cmd_runner_fmt .as_list (),
185
205
cpanm_version = cmd_runner_fmt .as_fixed ("--version" ),
186
206
)
@@ -254,7 +274,16 @@ def process(rc, out, err):
254
274
return
255
275
pkg_spec = self .sanitize_pkg_spec_version (v [pkg_param ], v .version )
256
276
257
- with self .runner (['notest' , 'locallib' , 'mirror' , 'mirror_only' , 'installdeps' , 'pkg_spec' ], output_process = process ) as ctx :
277
+ with self .runner ([
278
+ 'notest' ,
279
+ 'locallib' ,
280
+ 'mirror' ,
281
+ 'mirror_only' ,
282
+ 'installdeps' ,
283
+ 'install_recommendations' ,
284
+ 'install_suggestions' ,
285
+ 'pkg_spec'
286
+ ], output_process = process ) as ctx :
258
287
self .changed = ctx .run (pkg_spec = pkg_spec )
259
288
260
289
0 commit comments