Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux/lsb_release: parse version string (#318) #354

Merged

Conversation

ydirson
Copy link
Contributor

@ydirson ydirson commented Oct 23, 2023

When the lsb_release executable is not found the version is taken from /etc/os_release and properly parsed. When it is found, however, the string was essentially not parsed, resulting in only Version::Custom objects to be returned. Calling the proper parsing function does the trick, and Version::Semantic objects get created as expected.

The nearly manual handling of "rolling" for lsb_release, however, looks very suspicous, it should likely be folded to Version::from_string() instead.

When the lsb_release executable is not found the version is taken from
/etc/os_release and properly parsed.  When it is found, however, the
string was essentially not parsed, resulting in only Version::Custom
objects to be returned.  Calling the proper parsing function does the
trick, and Version::Semantic objects get created as expected.

The nearly manual handling of "rolling" for lsb_release, however,
looks very suspicous, it should likely be folded to
Version::from_string() instead.

Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
Copy link
Owner

@stanislav-tkach stanislav-tkach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the pull request and sorry for the delay!

@stanislav-tkach stanislav-tkach merged commit 13df8d7 into stanislav-tkach:master Nov 24, 2023
@ydirson ydirson deleted the parse-lsbrelease-version branch February 2, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants