mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 04:40:22 -07:00
pacman: Fix removing locally installed packages (#4464)
* pacman: Fix removing locally installed packages Without this, using `absent` state for a locally installed package (for example from AUR, or from a package that was dropped from repositories) would return that package is already removed, despite remaining installed * Undo unwanted whitespace removal * Add changelog fragment * Update changelogs/fragments/4464-pacman-fix-local-remove.yaml Co-authored-by: Felix Fontein <felix@fontein.de> * Add test. Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
fe4bbc5de3
commit
3c515dd221
5 changed files with 88 additions and 2 deletions
|
@ -610,8 +610,9 @@ class Pacman(object):
|
|||
# Expand group members
|
||||
for group_member in self.inventory["available_groups"][pkg]:
|
||||
pkg_list.append(Package(name=group_member, source=group_member))
|
||||
elif pkg in self.inventory["available_pkgs"]:
|
||||
# just a regular pkg
|
||||
elif pkg in self.inventory["available_pkgs"] or pkg in self.inventory["installed_pkgs"]:
|
||||
# Just a regular pkg, either available in the repositories,
|
||||
# or locally installed, which we need to know for absent state
|
||||
pkg_list.append(Package(name=pkg, source=pkg))
|
||||
else:
|
||||
# Last resort, call out to pacman to extract the info,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue