|
|
|
@ -254,6 +254,8 @@ def emerge_packages(module, packages):
|
|
|
|
|
break
|
|
|
|
|
else:
|
|
|
|
|
module.exit_json(changed=False, msg='Packages already present.')
|
|
|
|
|
if module.check_mode:
|
|
|
|
|
module.exit_json(changed=True, msg='Packages would be installed.')
|
|
|
|
|
|
|
|
|
|
args = []
|
|
|
|
|
emerge_flags = {
|
|
|
|
@ -298,13 +300,18 @@ def emerge_packages(module, packages):
|
|
|
|
|
changed = True
|
|
|
|
|
for line in out.splitlines():
|
|
|
|
|
if re.match(r'(?:>+) Emerging (?:binary )?\(1 of', line):
|
|
|
|
|
msg = 'Packages installed.'
|
|
|
|
|
break
|
|
|
|
|
elif module.check_mode and re.match(r'\[(binary|ebuild)', line):
|
|
|
|
|
msg = 'Packages would be installed.'
|
|
|
|
|
break
|
|
|
|
|
else:
|
|
|
|
|
changed = False
|
|
|
|
|
msg = 'No packages installed.'
|
|
|
|
|
|
|
|
|
|
module.exit_json(
|
|
|
|
|
changed=changed, cmd=cmd, rc=rc, stdout=out, stderr=err,
|
|
|
|
|
msg='Packages installed.',
|
|
|
|
|
msg=msg,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|