Skip to content

Add diff support even when not running in check mode #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion plugins/modules/aur.py
Original file line number Diff line number Diff line change
@@ -251,6 +251,11 @@ def install_packages(module, packages, use, extra_args, state, skip_pgp_check, i
"""
Install the specified packages
"""
diff = {
'before': '',
'after': '',
}

if local_pkgbuild:
assert use in use_cmd_local_pkgbuild
else:
@@ -259,9 +264,12 @@ def install_packages(module, packages, use, extra_args, state, skip_pgp_check, i
changed_iter = False

for package in packages:
if state == 'present' and package_installed(module, package):
already_installed = package_installed(module, package)
if state == 'present' and already_installed:
rc = 0
continue
if module._diff and not already_installed:
diff['after'] += package + "\n"
if use == 'makepkg':
rc, out, err = install_with_makepkg(module, package, extra_args, skip_pgp_check, ignore_arch, local_pkgbuild)
elif local_pkgbuild:
@@ -280,6 +288,7 @@ def install_packages(module, packages, use, extra_args, state, skip_pgp_check, i
msg=message if not rc else err,
helper=use,
rc=rc,
diff=diff,
)