Skip to content

Commit 837c43f

Browse files
committed
Add diff support even when not running in check mode
1 parent fe05001 commit 837c43f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

plugins/modules/aur.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,11 @@ def install_packages(module, packages, use, extra_args, state, skip_pgp_check, i
251251
"""
252252
Install the specified packages
253253
"""
254+
diff = {
255+
'before': '',
256+
'after': '',
257+
}
258+
254259
if local_pkgbuild:
255260
assert use in use_cmd_local_pkgbuild
256261
else:
@@ -259,9 +264,12 @@ def install_packages(module, packages, use, extra_args, state, skip_pgp_check, i
259264
changed_iter = False
260265

261266
for package in packages:
262-
if state == 'present' and package_installed(module, package):
267+
already_installed = package_installed(module, package)
268+
if state == 'present' and already_installed:
263269
rc = 0
264270
continue
271+
if module._diff and not already_installed:
272+
diff['after'] += package + "\n"
265273
if use == 'makepkg':
266274
rc, out, err = install_with_makepkg(module, package, extra_args, skip_pgp_check, ignore_arch, local_pkgbuild)
267275
elif local_pkgbuild:
@@ -280,6 +288,7 @@ def install_packages(module, packages, use, extra_args, state, skip_pgp_check, i
280288
msg=message if not rc else err,
281289
helper=use,
282290
rc=rc,
291+
diff=diff,
283292
)
284293

285294

0 commit comments

Comments
 (0)