-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat: Improve file_release support #329
base: master
Are you sure you want to change the base?
feat: Improve file_release support #329
Conversation
65b38e5
to
65d018d
Compare
Support more operating systems for file_release that lsb_release can already detect
…g unit tests * test: reorder `file_release::tests::retrieve` `expected_pairs` * test: accidentally discover and fix errors in tests of `centos-release` and `redhat-release` * test: stop test `release_info_debug` from debug printing * test: discard unknown version tests of `centos-release`, `fedora-release`, `mariner-release`, and `redhat-release`
* test: detect edition
* test: add codename detection
This reverts commit 4059955.
544c957
to
82c5617
Compare
I am finding some issues when categorizing some distributions. There is only one A similar issue appears between openSUSE Leap and openSUSE Tumbleweed, where the distinction is recorded as different It is unclear to me whether they should be categorized into editions anyway, or if new |
Sorry for the delay with response and thank you very much for the pull request! I'm also not sure in what direction to go with editions and families, so suggestions are welcome. Ideally I want to both preserve maximum information in a convenient way and not to over-complicate it. Originally I only wanted to have a string in any consistent format just to print it in logs and potentially show on a dashboard, but I understand that other people have different use cases. By the way, there already was a discussion about families, but people voiced the same concerns: sometimes it isn't obvious how to properly categorize a specific distribution. Additionally I think that versioning (the |
), | ||
]; | ||
|
||
for (root, expected) in expected_pairs { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also usually prefer to write tests like this, but now it stops at the first failure. Not a big issue, though.
My idea with families was more to deal with complications that can arise out of doing certain things on Linux platforms. As an example, comtrya is a config management tool. We have some logic that may change depending on the OS. using OS_Info for Windows and MacOS is a breeze to match on. Linux though is a pain because often what we want to do, the distro doesn't matter since what we are doing is quiet often universal to distributions. So the families was feature was a way to introduce where if I could rely on it is linux and the distro doesn't matter, the same action will work whether it is Debian or Fedora or Arch without need to create a bunch of arms to match against each distro to do the same thing. |
Description
Support more operating systems for
linux/file_release.rs
thatlinux/lsb_release.rs
can already detect.Allow
linux/file_release.rs
to detect more information about an operating system.Motivation
linux/file_release.rs
does not yet match the functionality oflinux/lsb_release.rs
. Some systems which are claimed to be supported on the README are not detected wherelsb_release
is not present.Todo
release
file instead of only the first match in order to obtain information that may be scattered between release files