Skip to content

Commit

Permalink
Implement use of --with-suggests cpanm option
Browse files Browse the repository at this point in the history
  • Loading branch information
ZephOne committed Jan 10, 2025
1 parent d6f8899 commit e521105
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
minor_changes:
- cpanm - enable usage of option ``--with-recommands`` (https://github.com/ansible-collections/community.general/issues/9554, https://github.com/ansible-collections/community.general/pull/9555).
- cpanm - enable usage of option ``--with-suggests`` (https://github.com/ansible-collections/community.general/issues/9554, https://github.com/ansible-collections/community.general/pull/9555).
9 changes: 9 additions & 0 deletions plugins/modules/cpanm.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@
type: bool
default: false
version_added: 10.3.0
install_suggestions:
description:
- Installs dependencies declared as suggested per META spec.
- When these dependencies fail to install, cpanm continues the installation, since they are just suggestion.
type: bool
default: false
version_added: 10.3.0
version:
description:
- Version specification for the perl module. When O(mode) is V(new), C(cpanm) version operators are accepted.
Expand Down Expand Up @@ -175,6 +182,7 @@ class CPANMinus(ModuleHelper):
mirror_only=dict(type='bool', default=False),
installdeps=dict(type='bool', default=False),
install_recommendations=dict(type='bool', default=False),
install_suggestions=dict(type='bool', default=False),
executable=dict(type='path'),
mode=dict(type='str', default='new', choices=['compatibility', 'new']),
name_check=dict(type='str')
Expand All @@ -190,6 +198,7 @@ class CPANMinus(ModuleHelper):
mirror_only=cmd_runner_fmt.as_bool("--mirror-only"),
installdeps=cmd_runner_fmt.as_bool("--installdeps"),
install_recommendations=cmd_runner_fmt.as_bool("--with-recommends", "--without-recommend", ignore_none=True),
install_suggestions=cmd_runner_fmt.as_bool("--with-suggests", "--without-suggests", ignore_none=True),
pkg_spec=cmd_runner_fmt.as_list(),
cpanm_version=cmd_runner_fmt.as_fixed("--version"),
)
Expand Down

0 comments on commit e521105

Please sign in to comment.