mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-19 17:01:25 -07:00
More resilient brew formulae name handling (#9665)
* Remove update_homebrew=False (it's the default) * Fix handling of irregular cases (brew does lowercase normalization) * Fix handling of tap with no public fallback * Add changelog fragment * Add missing cleanup step * Fix typo * Check re-install and re-uninstall too
This commit is contained in:
parent
191a4d8f63
commit
75ffae43e6
3 changed files with 125 additions and 29 deletions
|
@ -385,9 +385,11 @@ class Homebrew(object):
|
|||
self.outdated_packages.add(package_name)
|
||||
|
||||
def _extract_package_name(self, package_detail, is_cask):
|
||||
canonical_name = package_detail["full_token"] if is_cask else package_detail["full_name"] # For ex: 'sqlite'
|
||||
canonical_name = package_detail["full_token"] if is_cask else package_detail["full_name"] # For ex: 'sqlite', might contain a tap prefix.
|
||||
name = package_detail["token"] if is_cask else package_detail["name"] # For ex: 'sqlite'
|
||||
|
||||
all_valid_names = set(package_detail.get("aliases", [])) # For ex: {'sqlite3'}
|
||||
all_valid_names.add(canonical_name)
|
||||
all_valid_names.update((canonical_name, name))
|
||||
|
||||
# Then make sure the user provided name resurface.
|
||||
return (all_valid_names & set(self.packages)).pop()
|
||||
|
@ -831,7 +833,7 @@ def main():
|
|||
p = module.params
|
||||
|
||||
if p['name']:
|
||||
packages = p['name']
|
||||
packages = [package_name.lower() for package_name in p['name']]
|
||||
else:
|
||||
packages = None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue