Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- homebrew - emit a useful error message if ``brew info`` reports a package tap is ``null`` (https://github.com/ansible-collections/community.general/pull/10013, https://github.com/ansible-collections/community.general/issues/10012).
11 changes: 8 additions & 3 deletions plugins/modules/homebrew.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,15 @@ def _extract_package_name(self, package_detail, is_cask):
name = package_detail["name"]
full_name = package_detail["full_name"]

tapped_name = package_detail["tap"] + "/" + name
# Issue https://github.com/ansible-collections/community.general/issues/9803:
# name can include the tap as a prefix, in order to disambiguate,
# e.g. casks from identically named formulae.
#
# Issue https://github.com/ansible-collections/community.general/issues/10012:
# package_detail["tap"] is None if package is no longer available.
tapped_name = [package_detail["tap"] + "/" + name] if package_detail["tap"] else []
aliases = package_detail.get("aliases", [])

package_names = set([name, full_name, tapped_name] + aliases)
package_names = set([name, full_name] + tapped_name + aliases)

# Finally, identify which of all those package names was the one supplied by the user.
package_names = package_names & set(self.packages)
Expand Down