You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of Posix.get_package_information uses the package manager for a distro to query for a package information, then uses some regexes to force parse the package version into semver. This logic fails if a package does not follow semantic versioning for their versioning scheme. Example for Azure Linux (which uses rpm):
Suggestion: query the version directly using a distro's package tool/manager (dpkg/apt, rpm, etc), then return the raw version string as part of the result. If there is any logic to check versioning of a package, that logic can be implemented for each distro. Here is an example of how one can query a package version for debian and rpm based systems:
Debian: dpkg-query -f '${Version}' -W <pkg>
RPM: rpm --queryformat '%{VERSION}-%{RELEASE}' -q
I demoed this change in commit 365ce35, adding a new function _query_package since I don't want to change existing code yet. Please let me know your thoughts.
The text was updated successfully, but these errors were encountered:
The current implementation of
Posix.get_package_information
uses the package manager for a distro to query for a package information, then uses some regexes to force parse the package version into semver. This logic fails if a package does not follow semantic versioning for their versioning scheme. Example for Azure Linux (which uses rpm):Suggestion: query the version directly using a distro's package tool/manager (dpkg/apt, rpm, etc), then return the raw version string as part of the result. If there is any logic to check versioning of a package, that logic can be implemented for each distro. Here is an example of how one can query a package version for debian and rpm based systems:
dpkg-query -f '${Version}' -W <pkg>
I demoed this change in commit 365ce35, adding a new function
_query_package
since I don't want to change existing code yet. Please let me know your thoughts.The text was updated successfully, but these errors were encountered: