stanislav-tkach / os_info

Rust library to detect the operating system type
MIT License
175 stars 52 forks source link

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

Closed ydirson closed 1 year ago

ydirson commented 1 year ago

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.