2018-05-28 18:39:34 |
Eric Desrochers |
description |
[WHISHLIST]
While investigating how we can integrate snap detection in sosreport as a packagemanager just like 'rpm' and 'deb' package does when using "packages = (<PKG_NAME>,) to detect the presence of the package (if installed) in a sosreport plugin.
I notice there is no easy way to query all installed snaps and have it into a 'dpkg-query' output equivalent, unless doing a 'snap list' along with some 'awk', 'grep', 'sed' and family.
That would be helpful to be able to have a 'dpkg-query --showformat' equivalent for snap if possible.
# man dpkg-query
......
-f, --showformat=format
This option is used to specify the format of the output --show will produce. The format is a string that will be output for each package listed.
In the format string, “\” introduces escapes:
\n newline
\r carriage return
\t tab
......
According to sosreport official documentation :
https://github.com/sosreport/sos/wiki/How-to-Write-a-Policy
The expected output from sosreport packagemanager is :
package name|major.minor.bugfix version\n....
The output was based on what the following command offers :
# dpkg-query -W -f='${Package}|${Version}\\n' # debian
# rpm -qa --queryformat "%{NAME}|%{VERSION}|%{RELEASE}\\n" |
[WHISHLIST]
While investigating how we can integrate snap detection in sosreport as a packagemanager just like 'rpm' and 'deb' package does when using "packages = (<PKG_NAME>,) to detect the presence of the package (if installed) in a sosreport plugin.
I notice there is no easy way to query all installed snaps and have it into a 'dpkg-query' output equivalent, unless doing a 'snap list' along with some 'awk', 'grep', 'sed' and family.
That would be helpful to be able to have a 'dpkg-query --showformat' equivalent for snap if possible.
# man dpkg-query
......
-f, --showformat=format
This option is used to specify the format of the output --show will produce. The format is a string that will be output for each package listed.
In the format string, “\” introduces escapes:
\n newline
\r carriage return
\t tab
......
According to sosreport official documentation :
https://github.com/sosreport/sos/wiki/How-to-Write-a-Policy
The expected output from sosreport packagemanager is :
package name|major.minor.bugfix version\n....
The output was based on what the following command offers and still in use as of today in sosreport :
# dpkg-query -W -f='${Package}|${Version}\\n' # debian
# rpm -qa --queryformat "%{NAME}|%{VERSION}|%{RELEASE}\\n" |
|