mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
feat(mac_brew_pkg): Add support for aliases when getting info
This commit is contained in:
parent
436bdd50aa
commit
f420d779ba
1 changed files with 11 additions and 3 deletions
|
@ -460,7 +460,10 @@ def _info(*pkgs, options=None):
|
|||
return {}
|
||||
output = salt.utils.json.loads(brew_result["stdout"])
|
||||
|
||||
meta_info = {"formulae": ["name", "full_name"], "casks": ["token", "full_token"]}
|
||||
meta_info = {
|
||||
"formulae": ["name", "full_name", "aliases"],
|
||||
"casks": ["token", "full_token"],
|
||||
}
|
||||
|
||||
pkgs_info = dict()
|
||||
for tap, keys in meta_info.items():
|
||||
|
@ -469,9 +472,14 @@ def _info(*pkgs, options=None):
|
|||
continue
|
||||
|
||||
for _pkg in data:
|
||||
pkg_names = []
|
||||
for key in keys:
|
||||
if _pkg[key] in pkgs:
|
||||
pkgs_info[_pkg[key]] = _pkg
|
||||
pkg_names.append(_pkg[key])
|
||||
pkg_names = set(salt.utils.data.flatten(pkg_names))
|
||||
|
||||
for name in pkg_names:
|
||||
if name in pkgs:
|
||||
pkgs_info[name] = _pkg
|
||||
|
||||
return pkgs_info
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue