mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Use another separator on query to dpkg-query
This commit is contained in:
parent
ee70e38c78
commit
153ec95afa
1 changed files with 8 additions and 5 deletions
|
@ -271,9 +271,8 @@ def _get_pkg_info(*packages, **kwargs):
|
|||
"origin:${Origin}\\n"
|
||||
"homepage:${Homepage}\\n"
|
||||
"status:${db:Status-Abbrev}\\n"
|
||||
"======\\n"
|
||||
"description:${Description}\\n"
|
||||
"------\\n'"
|
||||
"\\n*/~^\\\\*\\n'"
|
||||
)
|
||||
cmd += " {}".format(" ".join(packages))
|
||||
cmd = cmd.strip()
|
||||
|
@ -287,9 +286,13 @@ def _get_pkg_info(*packages, **kwargs):
|
|||
else:
|
||||
return ret
|
||||
|
||||
for pkg_info in [elm for elm in re.split(r"------", call["stdout"]) if elm.strip()]:
|
||||
for pkg_info in [
|
||||
elm
|
||||
for elm in re.split(r"\r?\n\*/~\^\\\*(\r?\n|)", call["stdout"])
|
||||
if elm.strip()
|
||||
]:
|
||||
pkg_data = {}
|
||||
pkg_info, pkg_descr = re.split(r"======", pkg_info)
|
||||
pkg_info, pkg_descr = pkg_info.split("\ndescription:", 1)
|
||||
for pkg_info_line in [
|
||||
el.strip() for el in pkg_info.split(os.linesep) if el.strip()
|
||||
]:
|
||||
|
@ -299,7 +302,7 @@ def _get_pkg_info(*packages, **kwargs):
|
|||
install_date = _get_pkg_install_time(pkg_data.get("package"))
|
||||
if install_date:
|
||||
pkg_data["install_date"] = install_date
|
||||
pkg_data["description"] = pkg_descr.split(":", 1)[-1]
|
||||
pkg_data["description"] = pkg_descr
|
||||
ret.append(pkg_data)
|
||||
|
||||
return ret
|
||||
|
|
Loading…
Add table
Reference in a new issue