Skip to content

Commit

Permalink
Pacman: Fix name of URL packages (#4959)
Browse files Browse the repository at this point in the history
* Strip downloading... of unseen URLs

* Added changelog fragment

* Added integration tests for reason and reason_for

Inspired by the integration tests for url packages

* Revert "Added integration tests for reason and reason_for"

This reverts commit f60d92f.

Accidentally commited to the wrong branch.

(cherry picked from commit 788cfb6)
  • Loading branch information
Minei3oat authored and patchback[bot] committed Jul 21, 2022
1 parent 4d28956 commit 249e5f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/4959-pacman-fix-url-packages-name.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- pacman - fixed name resolution of URL packages (https://github.com/ansible-collections/community.general/pull/4959).
5 changes: 3 additions & 2 deletions plugins/modules/packaging/os/pacman.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,9 @@ def package_list(self):
stderr=stderr,
rc=rc,
)
# With Pacman v6.0.1 - libalpm v13.0.1, --upgrade outputs "loading packages..." on stdout. strip that
stdout = stdout.replace("loading packages...\n", "")
# With Pacman v6.0.1 - libalpm v13.0.1, --upgrade outputs " filename_without_extension downloading..." if the URL is unseen.
# In all cases, pacman outputs "loading packages..." on stdout. strip both
stdout = stdout.splitlines()[-1]
is_URL = True
pkg_name = stdout.strip()
pkg_list.append(Package(name=pkg_name, source=pkg, source_is_URL=is_URL))
Expand Down

0 comments on commit 249e5f4

Please sign in to comment.