'dpkg-query --showformat' equivalent for snap
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Confirmed
|
Undecided
|
Unassigned | ||
snapd (Ubuntu) |
Confirmed
|
Wishlist
|
Unassigned |
Bug 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:
......
According to sosreport official documentation :
https:/
The expected output from sosreport packagemanager is :
package name|major.
The output was based on what the following command offers and still in use as of today in sosreport :
# dpkg-query -W -f='${Package}
# rpm -qa --queryformat "%{NAME}
Changed in snapd (Ubuntu): | |
assignee: | nobody → Michael Vogt (mvo) |
Changed in snapd (Ubuntu): | |
assignee: | Michael Vogt (mvo) → nobody |
I talked to mvo about that this morning, and he said, he might be able to work on this on his spare time as it look trivial to add this feature according to him.