diff -Nru rust-os-info-3.4.0/Cargo.lock rust-os-info-3.5.1/Cargo.lock --- rust-os-info-3.4.0/Cargo.lock 1970-01-01 00:00:01.000000000 +0000 +++ rust-os-info-3.5.1/Cargo.lock 1970-01-01 00:00:01.000000000 +0000 @@ -3,15 +3,6 @@ version = 3 [[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - -[[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -19,9 +10,9 @@ [[package]] name = "ctor" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" +checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb" dependencies = [ "quote", "syn", @@ -29,9 +20,9 @@ [[package]] name = "diff" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" [[package]] name = "doc-comment" @@ -50,7 +41,7 @@ [[package]] name = "os_info" -version = "3.4.0" +version = "3.5.1" dependencies = [ "doc-comment", "log", @@ -70,48 +61,48 @@ [[package]] name = "pretty_assertions" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89f989ac94207d048d92db058e4f6ec7342b0971fc58d1271ca148b799b3563" +checksum = "a25e9bcb20aa780fd0bb16b72403a9064d6b3f22f026946029acb941a50af755" dependencies = [ - "ansi_term", "ctor", "diff", "output_vt100", + "yansi", ] [[package]] name = "proc-macro2" -version = "1.0.39" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.18" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] [[package]] name = "serde" -version = "1.0.137" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" +checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.137" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" +checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" dependencies = [ "proc-macro2", "quote", @@ -120,9 +111,9 @@ [[package]] name = "syn" -version = "1.0.95" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbaf6116ab8924f39d52792136fb74fd60a80194cf1b1c6ffa6453eef1c3f942" +checksum = "52205623b1b0f064a4e71182c3b18ae902267282930c6d5462c91b859668426e" dependencies = [ "proc-macro2", "quote", @@ -131,9 +122,9 @@ [[package]] name = "unicode-ident" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" +checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" [[package]] name = "winapi" @@ -156,3 +147,9 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" diff -Nru rust-os-info-3.4.0/Cargo.toml rust-os-info-3.5.1/Cargo.toml --- rust-os-info-3.4.0/Cargo.toml 1970-01-01 00:00:01.000000000 +0000 +++ rust-os-info-3.5.1/Cargo.toml 1970-01-01 00:00:01.000000000 +0000 @@ -12,7 +12,7 @@ [package] edition = "2018" name = "os_info" -version = "3.4.0" +version = "3.5.1" authors = [ "Jan Schulte ", "Stanislav Tkach ", diff -Nru rust-os-info-3.4.0/Cargo.toml.orig rust-os-info-3.5.1/Cargo.toml.orig --- rust-os-info-3.4.0/Cargo.toml.orig 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/Cargo.toml.orig 2006-07-24 01:21:28.000000000 +0000 @@ -1,6 +1,6 @@ [package] name = "os_info" -version = "3.4.0" +version = "3.5.1" authors = ["Jan Schulte ", "Stanislav Tkach "] description = "Detect the operating system type and version." documentation = "https://docs.rs/os_info" diff -Nru rust-os-info-3.4.0/.cargo_vcs_info.json rust-os-info-3.5.1/.cargo_vcs_info.json --- rust-os-info-3.4.0/.cargo_vcs_info.json 1970-01-01 00:00:01.000000000 +0000 +++ rust-os-info-3.5.1/.cargo_vcs_info.json 1970-01-01 00:00:01.000000000 +0000 @@ -1,6 +1,6 @@ { "git": { - "sha1": "f255a61adb26532fe88ac2c07b8ce226df21c66d" + "sha1": "c79cd093f4facc0783e0c07c948f5f5aa8409299" }, "path_in_vcs": "os_info" } \ No newline at end of file diff -Nru rust-os-info-3.4.0/debian/cargo-checksum.json rust-os-info-3.5.1/debian/cargo-checksum.json --- rust-os-info-3.4.0/debian/cargo-checksum.json 2022-06-03 04:49:25.000000000 +0000 +++ rust-os-info-3.5.1/debian/cargo-checksum.json 2023-01-10 14:25:14.000000000 +0000 @@ -1 +1 @@ -{"package":"0eca3ecae1481e12c3d9379ec541b238a16f0b75c9a409942daa8ec20dbfdb62","files":{}} +{"package":"c4750134fb6a5d49afc80777394ad5d95b04bc12068c6abb92fae8f43817270f","files":{}} diff -Nru rust-os-info-3.4.0/debian/changelog rust-os-info-3.5.1/debian/changelog --- rust-os-info-3.4.0/debian/changelog 2022-06-03 04:49:25.000000000 +0000 +++ rust-os-info-3.5.1/debian/changelog 2023-01-10 14:25:14.000000000 +0000 @@ -1,3 +1,10 @@ +rust-os-info (3.5.1-1) unstable; urgency=medium + + * Team upload. + * Package os_info 3.5.1 from crates.io using debcargo 2.6.0 + + -- Fabian Gruenbichler Tue, 10 Jan 2023 15:25:14 +0100 + rust-os-info (3.4.0-1) unstable; urgency=medium * Team upload. diff -Nru rust-os-info-3.4.0/debian/control rust-os-info-3.5.1/debian/control --- rust-os-info-3.4.0/debian/control 2022-06-03 04:49:25.000000000 +0000 +++ rust-os-info-3.5.1/debian/control 2023-01-10 14:25:14.000000000 +0000 @@ -23,7 +23,7 @@ Maintainer: Debian Rust Maintainers Uploaders: Sylvestre Ledru -Standards-Version: 4.5.1 +Standards-Version: 4.6.1 Vcs-Git: https://salsa.debian.org/rust-team/debcargo-conf.git [src/os-info] Vcs-Browser: https://salsa.debian.org/rust-team/debcargo-conf/tree/master/src/os-info Homepage: https://github.com/stanislav-tkach/os_info @@ -55,12 +55,12 @@ librust-os-info-3-dev (= ${binary:Version}), librust-os-info-3+default-dev (= ${binary:Version}), librust-os-info-3+serde-dev (= ${binary:Version}), - librust-os-info-3.4-dev (= ${binary:Version}), - librust-os-info-3.4+default-dev (= ${binary:Version}), - librust-os-info-3.4+serde-dev (= ${binary:Version}), - librust-os-info-3.4.0-dev (= ${binary:Version}), - librust-os-info-3.4.0+default-dev (= ${binary:Version}), - librust-os-info-3.4.0+serde-dev (= ${binary:Version}) + librust-os-info-3.5-dev (= ${binary:Version}), + librust-os-info-3.5+default-dev (= ${binary:Version}), + librust-os-info-3.5+serde-dev (= ${binary:Version}), + librust-os-info-3.5.1-dev (= ${binary:Version}), + librust-os-info-3.5.1+default-dev (= ${binary:Version}), + librust-os-info-3.5.1+serde-dev (= ${binary:Version}) Description: Detect the operating system type and version - Rust source code This package contains the source for the Rust os_info crate, packaged by debcargo for use with cargo and dh-cargo. diff -Nru rust-os-info-3.4.0/debian/copyright.debcargo.hint rust-os-info-3.5.1/debian/copyright.debcargo.hint --- rust-os-info-3.4.0/debian/copyright.debcargo.hint 2022-06-03 04:49:25.000000000 +0000 +++ rust-os-info-3.5.1/debian/copyright.debcargo.hint 2023-01-10 14:25:14.000000000 +0000 @@ -16,7 +16,7 @@ be correct information so you should review and fix this before uploading to the archive. -Files: ./LICENSE +Files: LICENSE Copyright: 2017 Stanislav Tkach License: UNKNOWN-LICENSE; FIXME (overlay) Comment: @@ -25,8 +25,8 @@ Files: debian/* Copyright: - 2020-2022 Debian Rust Maintainers - 2020-2022 Sylvestre Ledru + 2020-2023 Debian Rust Maintainers + 2020-2023 Sylvestre Ledru License: MIT License: MIT diff -Nru rust-os-info-3.4.0/debian/tests/control rust-os-info-3.5.1/debian/tests/control --- rust-os-info-3.4.0/debian/tests/control 2022-06-03 04:49:25.000000000 +0000 +++ rust-os-info-3.5.1/debian/tests/control 2023-01-10 14:25:14.000000000 +0000 @@ -1,19 +1,19 @@ -Test-Command: /usr/share/cargo/bin/cargo-auto-test os_info 3.4.0 --all-targets --all-features +Test-Command: /usr/share/cargo/bin/cargo-auto-test os_info 3.5.1 --all-targets --all-features Features: test-name=rust-os-info:@ Depends: dh-cargo (>= 18), librust-doc-comment-0.3+default-dev (>= 0.3.1-~~), librust-pretty-assertions-1+default-dev, @ Restrictions: allow-stderr, skip-not-installable -Test-Command: /usr/share/cargo/bin/cargo-auto-test os_info 3.4.0 --all-targets +Test-Command: /usr/share/cargo/bin/cargo-auto-test os_info 3.5.1 --all-targets Features: test-name=librust-os-info-dev:default Depends: dh-cargo (>= 18), librust-doc-comment-0.3+default-dev (>= 0.3.1-~~), librust-pretty-assertions-1+default-dev, @ Restrictions: allow-stderr, skip-not-installable -Test-Command: /usr/share/cargo/bin/cargo-auto-test os_info 3.4.0 --all-targets --no-default-features --features serde +Test-Command: /usr/share/cargo/bin/cargo-auto-test os_info 3.5.1 --all-targets --no-default-features --features serde Features: test-name=librust-os-info-dev:serde Depends: dh-cargo (>= 18), librust-doc-comment-0.3+default-dev (>= 0.3.1-~~), librust-pretty-assertions-1+default-dev, @ Restrictions: allow-stderr, skip-not-installable -Test-Command: /usr/share/cargo/bin/cargo-auto-test os_info 3.4.0 --all-targets --no-default-features +Test-Command: /usr/share/cargo/bin/cargo-auto-test os_info 3.5.1 --all-targets --no-default-features Features: test-name=librust-os-info-dev: Depends: dh-cargo (>= 18), librust-doc-comment-0.3+default-dev (>= 0.3.1-~~), librust-pretty-assertions-1+default-dev, @ Restrictions: allow-stderr, skip-not-installable diff -Nru rust-os-info-3.4.0/README.md rust-os-info-3.5.1/README.md --- rust-os-info-3.4.0/README.md 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/README.md 2006-07-24 01:21:28.000000000 +0000 @@ -12,7 +12,7 @@ **Project details:** [![LoC](https://tokei.rs/b1/github/stanislav-tkach/os_info)](https://github.com/stanislav-tkach/os_info) -![Rust 1.41+ required](https://img.shields.io/badge/rust-1.41+-blue.svg?label=Required%20Rust) +![Rust 1.45+ required](https://img.shields.io/badge/rust-1.41+-blue.svg?label=Required%20Rust) ## Overview @@ -89,20 +89,23 @@ - EndeavourOS - Fedora - FreeBSD +- Garuda Linux +- Gentoo Linux - HardenedBSD - Illumos - Linux -- Linux Mint - macOS (Mac OS X or OS X) - Manjaro +- Mariner - MidnightBSD +- Mint - NetBSD - NixOS - OpenBSD - openSUSE - Oracle Linux - Pop!_OS -- Raspberry OS +- Raspberry Pi OS - Red Hat Linux - Red Hat Enterprise Linux - Redox diff -Nru rust-os-info-3.4.0/src/linux/file_release.rs rust-os-info-3.5.1/src/linux/file_release.rs --- rust-os-info-3.4.0/src/linux/file_release.rs 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/file_release.rs 2006-07-24 01:21:28.000000000 +0000 @@ -1,124 +1,192 @@ // spell-checker:ignore sles -use std::{fs::File, io::Read, path::Path}; +use std::{fmt, fs::File, io::Read, path::Path}; use log::{trace, warn}; use crate::{matcher::Matcher, Bitness, Info, Type, Version}; pub fn get() -> Option { - retrieve(&DISTRIBUTIONS) + retrieve(&DISTRIBUTIONS, "/") } -fn retrieve(distributions: &[ReleaseInfo]) -> Option { +fn retrieve(distributions: &[ReleaseInfo], root: &str) -> Option { for release_info in distributions { - if !Path::new(release_info.path).exists() { + let path = Path::new(root).join(release_info.path); + + if !path.exists() { trace!("Path '{}' doesn't exist", release_info.path); continue; } - let mut file = match File::open(&release_info.path) { + let mut file = match File::open(&path) { Ok(val) => val, Err(e) => { - warn!("Unable to open {:?} file: {:?}", release_info.path, e); + warn!("Unable to open {:?} file: {:?}", &path, e); continue; } }; let mut file_content = String::new(); if let Err(e) = file.read_to_string(&mut file_content) { - warn!("Unable to read {:?} file: {:?}", release_info.path, e); + warn!("Unable to read {:?} file: {:?}", &path, e); continue; } - let os_type = Matcher::KeyValue { key: "NAME" } - .find(&file_content) - .and_then(|name| get_type(&name)) - .unwrap_or(release_info.os_type); - - let version = release_info - .version_matcher - .find(&file_content) - .map(Version::from_string) - .unwrap_or_else(|| Version::Unknown); + let os_type = (release_info.os_type)(&file_content); + + // If os_type is indeterminate, try the next release_info + if os_type.is_none() { + continue; + } + + let version = (release_info.version)(&file_content); return Some(Info { - os_type, - version, + os_type: os_type.unwrap(), + version: version.unwrap_or(Version::Unknown), bitness: Bitness::Unknown, ..Default::default() }); } + // Failed to determine os info None } -fn get_type(name: &str) -> Option { - match name.to_lowercase().as_ref() { - "alpine linux" => Some(Type::Alpine), - "amazon linux" => Some(Type::Amazon), - "amazon linux ami" => Some(Type::Amazon), - "arch linux" => Some(Type::Arch), - "centos linux" => Some(Type::CentOS), - "centos stream" => Some(Type::CentOS), - "fedora" => Some(Type::Fedora), - "fedora linux" => Some(Type::Fedora), - "linux mint" => Some(Type::Mint), - "mariner" => Some(Type::Mariner), - "nixos" => Some(Type::NixOS), - "red hat enterprise linux" => Some(Type::Redhat), - "sles" => Some(Type::SUSE), - "ubuntu" => Some(Type::Ubuntu), - _ => None, - } -} - -#[derive(Debug, Clone)] +/// Struct containing information on how to parse distribution info from a release file. +#[derive(Clone)] struct ReleaseInfo<'a> { - os_type: Type, + /// Relative path to the release file this struct corresponds to from root. path: &'a str, - version_matcher: Matcher, + + /// A closure that determines the os type from the release file contents. + os_type: for<'b> fn(&'b str) -> Option, + + /// A closure that determines the os version from the release file contents. + version: for<'b> fn(&'b str) -> Option, +} + +impl fmt::Debug for ReleaseInfo<'_> { + fn fmt<'a>(&'a self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("ReleaseInfo") + .field("path", &self.path) + .field("os_type", &(self.os_type as fn(&'a str) -> Option)) + .field("version", &(self.version as fn(&'a str) -> Option)) + .finish() + } } /// List of all supported distributions and the information on how to parse their version from the /// release file. -const DISTRIBUTIONS: [ReleaseInfo; 6] = [ - // Due to shenanigans with Oracle Linux including an /etc/redhat-release file that states - // that the OS is Red Hat Enterprise Linux, this /etc/os-release file MUST be checked - // before this code checks /etc/redhat-release. If it does not get run first, - // it will unintentionally report that the operating system is Red Hat Enterprise Linux - // instead of Oracle Linux. +static DISTRIBUTIONS: [ReleaseInfo; 6] = [ + // Keep this first; most modern distributions have this file. ReleaseInfo { - os_type: Type::Mariner, - path: "/etc/mariner-release", - version_matcher: Matcher::PrefixedVersion { - prefix: "CBL-Mariner ", + path: "etc/os-release", + os_type: |release| { + Matcher::KeyValue { key: "ID" } + .find(release) + .and_then(|id| match id.as_str() { + // os-release information collected from + // https://github.com/chef/os_release + + //"almalinux" => Alma + "alpine" => Some(Type::Alpine), + "amzn" => Some(Type::Amazon), + //"antergos" => Antergos + //"aosc" => AOSC + "arch" => Some(Type::Arch), + //"artix" => Artix + "centos" => Some(Type::CentOS), + //"clear-linux-os" => ClearLinuxOS + //"clearos" => ClearOS + //"coreos" + //"cumulus-linux" => Cumulus + //"debian" => Debian + //"devuan" => Devuan + //"elementary" => Elementary + "fedora" => Some(Type::Fedora), + //"gentoo" => Gentoo + //"ios_xr" => ios_xr + //"kali" => Kali + //"mageia" => Mageia + //"manjaro" => Manjaro + "linuxmint" => Some(Type::Mint), + "mariner" => Some(Type::Mariner), + //"nexus" => Nexus + "nixos" => Some(Type::NixOS), + "ol" => Some(Type::OracleLinux), + "opensuse" => Some(Type::openSUSE), + "opensuse-leap" => Some(Type::openSUSE), + //"rancheros" => RancherOS + //"raspbian" => Raspbian + // note XBian also uses "raspbian" + "rhel" => Some(Type::RedHatEnterprise), + //"rocky" => Rocky + //"sabayon" => Sabayon + //"scientific" => Scientific + //"slackware" => Slackware + "sled" => Some(Type::SUSE), // SUSE desktop + "sles" => Some(Type::SUSE), + "sles_sap" => Some(Type::SUSE), // SUSE SAP + "ubuntu" => Some(Type::Ubuntu), + //"virtuozzo" => Virtuozzo + //"void" => Void + //"XCP-ng" => xcp-ng + //"xenenterprise" => xcp-ng + //"xenserver" => xcp-ng + _ => None, + }) + }, + version: |release| { + Matcher::KeyValue { key: "VERSION_ID" } + .find(release) + .map(Version::from_string) }, }, + // Older distributions must have their specific release file parsed. ReleaseInfo { - os_type: Type::CentOS, - path: "/etc/centos-release", - version_matcher: Matcher::PrefixedVersion { prefix: "release" }, + path: "etc/mariner-release", + os_type: |_| Some(Type::Mariner), + version: |release| { + Matcher::PrefixedVersion { + prefix: "CBL-Mariner", + } + .find(release) + .map(Version::from_string) + }, }, ReleaseInfo { - os_type: Type::Fedora, - path: "/etc/fedora-release", - version_matcher: Matcher::PrefixedVersion { prefix: "release" }, + path: "etc/centos-release", + os_type: |_| Some(Type::CentOS), + version: |release| { + Matcher::PrefixedVersion { prefix: "release" } + .find(release) + .map(Version::from_string) + }, }, ReleaseInfo { - os_type: Type::Alpine, - path: "/etc/alpine-release", - version_matcher: Matcher::AllTrimmed, + path: "etc/fedora-release", + os_type: |_| Some(Type::Fedora), + version: |release| { + Matcher::PrefixedVersion { prefix: "release" } + .find(release) + .map(Version::from_string) + }, }, ReleaseInfo { - os_type: Type::OracleLinux, - path: "/etc/os-release", - version_matcher: Matcher::KeyValue { key: "VERSION_ID" }, + path: "etc/alpine-release", + os_type: |_| Some(Type::Alpine), + version: |release| Matcher::AllTrimmed.find(release).map(Version::from_string), }, ReleaseInfo { - os_type: Type::Redhat, - path: "/etc/redhat-release", - version_matcher: Matcher::PrefixedVersion { prefix: "release" }, + path: "etc/redhat-release", + os_type: |_| Some(Type::RedHatEnterprise), + version: |release| { + Matcher::PrefixedVersion { prefix: "release" } + .find(release) + .map(Version::from_string) + }, }, ]; @@ -128,35 +196,32 @@ use pretty_assertions::assert_eq; #[test] - fn oracle_linux() { - let mut distributions = [DISTRIBUTIONS[4].clone()]; - distributions[0].path = "src/linux/tests/os-release"; + fn alpine_3_12_os_release() { + let root = "src/linux/tests/Alpine_3_12"; - let info = retrieve(&distributions).unwrap(); - assert_eq!(info.os_type(), Type::OracleLinux); - assert_eq!(info.version, Version::Semantic(8, 1, 0)); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::Alpine); + assert_eq!(info.version, Version::Semantic(3, 12, 0)); assert_eq!(info.edition, None); assert_eq!(info.codename, None); } #[test] - fn os_release_alpine_3_12() { - let mut distributions = [DISTRIBUTIONS[4].clone()]; - distributions[0].path = "src/linux/tests/os-release-alpine-3-12"; + fn alpine_release() { + let root = "src/linux/tests/Alpine"; - let info = retrieve(&distributions).unwrap(); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); assert_eq!(info.os_type(), Type::Alpine); - assert_eq!(info.version, Version::Semantic(3, 12, 0)); + assert_eq!(info.version, Version::Custom("A.B.C".to_owned())); assert_eq!(info.edition, None); assert_eq!(info.codename, None); } #[test] - fn os_release_amazon_1() { - let mut distributions = [DISTRIBUTIONS[4].clone()]; - distributions[0].path = "src/linux/tests/os-release-amazon-1"; + fn amazon_1_os_release() { + let root = "src/linux/tests/Amazon_1"; - let info = retrieve(&distributions).unwrap(); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); assert_eq!(info.os_type(), Type::Amazon); assert_eq!(info.version, Version::Semantic(2018, 3, 0)); assert_eq!(info.edition, None); @@ -164,11 +229,10 @@ } #[test] - fn os_release_amazon_2() { - let mut distributions = [DISTRIBUTIONS[4].clone()]; - distributions[0].path = "src/linux/tests/os-release-amazon-2"; + fn amazon_2_os_release() { + let root = "src/linux/tests/Amazon_2"; - let info = retrieve(&distributions).unwrap(); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); assert_eq!(info.os_type(), Type::Amazon); assert_eq!(info.version, Version::Semantic(2, 0, 0)); assert_eq!(info.edition, None); @@ -176,11 +240,10 @@ } #[test] - fn os_release_centos() { - let mut distributions = [DISTRIBUTIONS[4].clone()]; - distributions[0].path = "src/linux/tests/os-release-centos"; + fn centos_7_os_release() { + let root = "src/linux/tests/CentOS_7"; - let info = retrieve(&distributions).unwrap(); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); assert_eq!(info.os_type(), Type::CentOS); assert_eq!(info.version, Version::Semantic(7, 0, 0)); assert_eq!(info.edition, None); @@ -188,11 +251,10 @@ } #[test] - fn os_release_centos_stream() { - let mut distributions = [DISTRIBUTIONS[4].clone()]; - distributions[0].path = "src/linux/tests/os-release-centos-stream"; + fn centos_stream_os_release() { + let root = "src/linux/tests/CentOS_Stream"; - let info = retrieve(&distributions).unwrap(); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); assert_eq!(info.os_type(), Type::CentOS); assert_eq!(info.version, Version::Semantic(8, 0, 0)); assert_eq!(info.edition, None); @@ -200,11 +262,32 @@ } #[test] - fn os_release_fedora() { - let mut distributions = [DISTRIBUTIONS[4].clone()]; - distributions[0].path = "src/linux/tests/os-release-fedora-32"; + fn centos_release() { + let root = "src/linux/tests/CentOS"; - let info = retrieve(&distributions).unwrap(); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::CentOS); + assert_eq!(info.version, Version::Custom("XX".to_owned())); + assert_eq!(info.edition, None); + assert_eq!(info.codename, None); + } + + #[test] + fn centos_release_unknown() { + let root = "src/linux/tests/CentOS_Unknown"; + + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::CentOS); + assert_eq!(info.version, Version::Unknown); + assert_eq!(info.edition, None); + assert_eq!(info.codename, None); + } + + #[test] + fn fedora_32_os_release() { + let root = "src/linux/tests/Fedora_32"; + + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); assert_eq!(info.os_type(), Type::Fedora); assert_eq!(info.version, Version::Semantic(32, 0, 0)); assert_eq!(info.edition, None); @@ -212,11 +295,10 @@ } #[test] - fn os_release_fedora_35() { - let mut distributions = [DISTRIBUTIONS[4].clone()]; - distributions[0].path = "src/linux/tests/os-release-fedora-35"; + fn fedora_35_os_release() { + let root = "src/linux/tests/Fedora_35"; - let info = retrieve(&distributions).unwrap(); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); assert_eq!(info.os_type(), Type::Fedora); assert_eq!(info.version, Version::Semantic(35, 0, 0)); assert_eq!(info.edition, None); @@ -224,11 +306,65 @@ } #[test] - fn os_release_nixos() { - let mut distributions = [DISTRIBUTIONS[4].clone()]; - distributions[0].path = "src/linux/tests/os-release-nixos"; + fn fedora_release() { + let root = "src/linux/tests/Fedora"; - let info = retrieve(&distributions).unwrap(); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::Fedora); + assert_eq!(info.version, Version::Semantic(26, 0, 0)); + assert_eq!(info.edition, None); + assert_eq!(info.codename, None); + } + + #[test] + fn fedora_release_unknown() { + let root = "src/linux/tests/Fedora_Unknown"; + + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::Fedora); + assert_eq!(info.version, Version::Unknown); + assert_eq!(info.edition, None); + assert_eq!(info.codename, None); + } + + #[test] + fn mariner_release() { + let root = "src/linux/tests/Mariner"; + + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::Mariner); + assert_eq!(info.version, Version::Semantic(2, 0, 20220210)); + assert_eq!(info.edition, None); + assert_eq!(info.codename, None); + } + + #[test] + fn mariner_release_unknown() { + let root = "src/linux/tests/Mariner_Unknown"; + + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::Mariner); + assert_eq!(info.version, Version::Unknown); + assert_eq!(info.edition, None); + assert_eq!(info.codename, None); + } + + #[test] + fn mint_os_release() { + let root = "src/linux/tests/Mint"; + + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::Mint); + assert_eq!(info.version, Version::Semantic(20, 0, 0)); + assert_eq!(info.edition, None); + assert_eq!(info.codename, None); + } + + #[test] + fn nixos_os_release() { + let root = "src/linux/tests/NixOS"; + + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); assert_eq!(info.os_type(), Type::NixOS); assert_eq!( info.version, @@ -239,122 +375,119 @@ } #[test] - fn os_release_rhel() { - let mut distributions = [DISTRIBUTIONS[4].clone()]; - distributions[0].path = "src/linux/tests/os-release-rhel"; + fn none_invalid_os_release() { + let root = "src/linux/tests/none_invalid_os_release"; - let info = retrieve(&distributions).unwrap(); - assert_eq!(info.os_type(), Type::Redhat); - assert_eq!(info.version, Version::Semantic(8, 2, 0)); - assert_eq!(info.edition, None); - assert_eq!(info.codename, None); + let info = retrieve(&DISTRIBUTIONS, root); + assert_eq!(info, None); } #[test] - fn os_release_suse_12() { - let mut distributions = [DISTRIBUTIONS[4].clone()]; - distributions[0].path = "src/linux/tests/os-release-suse-12"; + fn none_no_release() { + let root = "src/linux/tests/none_no_release"; - let info = retrieve(&distributions).unwrap(); - assert_eq!(info.os_type(), Type::SUSE); - assert_eq!(info.version, Version::Semantic(12, 5, 0)); - assert_eq!(info.edition, None); - assert_eq!(info.codename, None); + let info = retrieve(&DISTRIBUTIONS, root); + assert_eq!(info, None); } #[test] - fn os_release_suse_15() { - let mut distributions = [DISTRIBUTIONS[4].clone()]; - distributions[0].path = "src/linux/tests/os-release-suse-15"; + fn none_no_path() { + let root = "src/linux/tests/none_no_path"; - let info = retrieve(&distributions).unwrap(); - assert_eq!(info.os_type(), Type::SUSE); - assert_eq!(info.version, Version::Semantic(15, 2, 0)); + let info = retrieve(&DISTRIBUTIONS, root); + assert_eq!(info, None); + } + + #[test] + fn oracle_linux_os_release() { + let root = "src/linux/tests/OracleLinux"; + + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::OracleLinux); + assert_eq!(info.version, Version::Semantic(8, 1, 0)); assert_eq!(info.edition, None); assert_eq!(info.codename, None); } #[test] - fn os_release_ubuntu() { - let mut distributions = [DISTRIBUTIONS[4].clone()]; - distributions[0].path = "src/linux/tests/os-release-ubuntu"; + fn rhel_8_os_release() { + let root = "src/linux/tests/RedHatEnterprise_8"; - let info = retrieve(&distributions).unwrap(); - assert_eq!(info.os_type(), Type::Ubuntu); - assert_eq!(info.version, Version::Semantic(18, 10, 0)); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::RedHatEnterprise); + assert_eq!(info.version, Version::Semantic(8, 2, 0)); assert_eq!(info.edition, None); assert_eq!(info.codename, None); } #[test] - fn os_release_mint() { - let mut distributions = [DISTRIBUTIONS[4].clone()]; - distributions[0].path = "src/linux/tests/os-release-mint"; + fn rhel_7_os_release() { + let root = "src/linux/tests/RedHatEnterprise_7"; - let info = retrieve(&distributions).unwrap(); - assert_eq!(info.os_type(), Type::Mint); - assert_eq!(info.version, Version::Semantic(20, 0, 0)); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::RedHatEnterprise); + assert_eq!(info.version, Version::Semantic(7, 9, 0)); assert_eq!(info.edition, None); assert_eq!(info.codename, None); } #[test] - fn centos() { - let mut distributions = [DISTRIBUTIONS[1].clone()]; - distributions[0].path = "src/linux/tests/centos-release"; + fn redhat_release() { + let root = "src/linux/tests/RedHatEnterprise"; - let info = retrieve(&distributions).unwrap(); - assert_eq!(info.os_type(), Type::CentOS); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::RedHatEnterprise); assert_eq!(info.version, Version::Custom("XX".to_owned())); assert_eq!(info.edition, None); assert_eq!(info.codename, None); } #[test] - fn fedora() { - let mut distributions = [DISTRIBUTIONS[2].clone()]; - distributions[0].path = "src/linux/tests/fedora-release"; + fn redhat_release_unknown() { + let root = "src/linux/tests/RedHatEnterprise_Unknown"; - let info = retrieve(&distributions).unwrap(); - assert_eq!(info.os_type(), Type::Fedora); - assert_eq!(info.version, Version::Semantic(26, 0, 0)); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::RedHatEnterprise); + assert_eq!(info.version, Version::Unknown); assert_eq!(info.edition, None); assert_eq!(info.codename, None); } #[test] - fn redhat() { - let mut distributions = [DISTRIBUTIONS[5].clone()]; - distributions[0].path = "src/linux/tests/redhat-release"; + fn suse_12_os_release() { + let root = "src/linux/tests/SUSE_12"; - let info = retrieve(&distributions).unwrap(); - assert_eq!(info.os_type(), Type::Redhat); - assert_eq!(info.version, Version::Custom("XX".to_owned())); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::SUSE); + assert_eq!(info.version, Version::Semantic(12, 5, 0)); assert_eq!(info.edition, None); assert_eq!(info.codename, None); } #[test] - fn alpine() { - let mut distributions = [DISTRIBUTIONS[3].clone()]; - distributions[0].path = "src/linux/tests/alpine-release"; + fn suse_15_os_release() { + let root = "src/linux/tests/SUSE_15"; - let info = retrieve(&distributions).unwrap(); - assert_eq!(info.os_type(), Type::Alpine); - assert_eq!(info.version, Version::Custom("A.B.C".to_owned())); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::SUSE); + assert_eq!(info.version, Version::Semantic(15, 2, 0)); assert_eq!(info.edition, None); assert_eq!(info.codename, None); } #[test] - fn mariner() { - let mut distributions = [DISTRIBUTIONS[0].clone()]; - distributions[0].path = "src/linux/tests/mariner-release"; + fn ubuntu_os_release() { + let root = "src/linux/tests/Ubuntu"; - let info = retrieve(&distributions).unwrap(); - assert_eq!(info.os_type(), Type::Mariner); - assert_eq!(info.version, Version::Semantic(2, 0, 20220210)); + let info = retrieve(&DISTRIBUTIONS, root).unwrap(); + assert_eq!(info.os_type(), Type::Ubuntu); + assert_eq!(info.version, Version::Semantic(18, 10, 0)); assert_eq!(info.edition, None); assert_eq!(info.codename, None); } + + #[test] + fn release_info_debug() { + dbg!("{:?}", &DISTRIBUTIONS[0]); + } } diff -Nru rust-os-info-3.4.0/src/linux/lsb_release.rs rust-os-info-3.5.1/src/linux/lsb_release.rs --- rust-os-info-3.4.0/src/linux/lsb_release.rs 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/lsb_release.rs 2006-07-24 01:21:28.000000000 +0000 @@ -22,6 +22,7 @@ Some("Debian") => Type::Debian, Some("EndeavourOS") => Type::EndeavourOS, Some("Fedora") | Some("Fedora Linux") => Type::Fedora, + Some("Garuda") => Type::Garuda, Some("Gentoo") => Type::Gentoo, Some("Linuxmint") => Type::Mint, Some("ManjaroLinux") => Type::Manjaro, diff -Nru rust-os-info-3.4.0/src/linux/mod.rs rust-os-info-3.5.1/src/linux/mod.rs --- rust-os-info-3.4.0/src/linux/mod.rs 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/mod.rs 2006-07-24 01:21:28.000000000 +0000 @@ -32,6 +32,8 @@ | Type::Debian | Type::EndeavourOS | Type::Fedora + | Type::Garuda + | Type::Gentoo | Type::Linux | Type::Manjaro | Type::Mariner diff -Nru rust-os-info-3.4.0/src/linux/tests/Alpine/etc/alpine-release rust-os-info-3.5.1/src/linux/tests/Alpine/etc/alpine-release --- rust-os-info-3.4.0/src/linux/tests/Alpine/etc/alpine-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/Alpine/etc/alpine-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1 @@ +A.B.C diff -Nru rust-os-info-3.4.0/src/linux/tests/Alpine_3_12/etc/os-release rust-os-info-3.5.1/src/linux/tests/Alpine_3_12/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/Alpine_3_12/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/Alpine_3_12/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,6 @@ +NAME="Alpine Linux" +ID=alpine +VERSION_ID=3.12.0 +PRETTY_NAME="Alpine Linux v3.12" +HOME_URL="https://alpinelinux.org/" +BUG_REPORT_URL="https://bugs.alpinelinux.org/" diff -Nru rust-os-info-3.4.0/src/linux/tests/alpine-release rust-os-info-3.5.1/src/linux/tests/alpine-release --- rust-os-info-3.4.0/src/linux/tests/alpine-release 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/alpine-release 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -A.B.C diff -Nru rust-os-info-3.4.0/src/linux/tests/Amazon_1/etc/os-release rust-os-info-3.5.1/src/linux/tests/Amazon_1/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/Amazon_1/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/Amazon_1/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,9 @@ +NAME="Amazon Linux AMI" +VERSION="2018.03" +ID="amzn" +ID_LIKE="rhel fedora" +VERSION_ID="2018.03" +PRETTY_NAME="Amazon Linux AMI 2018.03" +ANSI_COLOR="0;33" +CPE_NAME="cpe:/o:amazon:linux:2018.03:ga" +HOME_URL="http://aws.amazon.com/amazon-linux-ami/" diff -Nru rust-os-info-3.4.0/src/linux/tests/Amazon_2/etc/os-release rust-os-info-3.5.1/src/linux/tests/Amazon_2/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/Amazon_2/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/Amazon_2/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,9 @@ +NAME="Amazon Linux" +VERSION="2" +ID="amzn" +ID_LIKE="centos rhel fedora" +VERSION_ID="2" +PRETTY_NAME="Amazon Linux 2" +ANSI_COLOR="0;33" +CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2" +HOME_URL="https://amazonlinux.com/" diff -Nru rust-os-info-3.4.0/src/linux/tests/CentOS/etc/centos-release rust-os-info-3.5.1/src/linux/tests/CentOS/etc/centos-release --- rust-os-info-3.4.0/src/linux/tests/CentOS/etc/centos-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/CentOS/etc/centos-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1 @@ +Centos Linux release XX diff -Nru rust-os-info-3.4.0/src/linux/tests/CentOS_7/etc/os-release rust-os-info-3.5.1/src/linux/tests/CentOS_7/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/CentOS_7/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/CentOS_7/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,15 @@ +NAME="CentOS Linux" +VERSION="7 (Core)" +ID="centos" +ID_LIKE="rhel fedora" +VERSION_ID="7" +PRETTY_NAME="CentOS Linux 7 (Core)" +ANSI_COLOR="0;31" +CPE_NAME="cpe:/o:centos:centos:7" +HOME_URL="https://www.centos.org/" +BUG_REPORT_URL="https://bugs.centos.org/" + +CENTOS_MANTISBT_PROJECT="CentOS-7" +CENTOS_MANTISBT_PROJECT_VERSION="7" +REDHAT_SUPPORT_PRODUCT="centos" +REDHAT_SUPPORT_PRODUCT_VERSION="7" diff -Nru rust-os-info-3.4.0/src/linux/tests/centos-release rust-os-info-3.5.1/src/linux/tests/centos-release --- rust-os-info-3.4.0/src/linux/tests/centos-release 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/centos-release 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Centos Linux release XX diff -Nru rust-os-info-3.4.0/src/linux/tests/CentOS_Stream/etc/os-release rust-os-info-3.5.1/src/linux/tests/CentOS_Stream/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/CentOS_Stream/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/CentOS_Stream/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,13 @@ +NAME="CentOS Stream" +VERSION="8" +ID="centos" +ID_LIKE="rhel fedora" +VERSION_ID="8" +PLATFORM_ID="platform:el8" +PRETTY_NAME="CentOS Stream 8" +ANSI_COLOR="0;31" +CPE_NAME="cpe:/o:centos:centos:8" +HOME_URL="https://centos.org/" +BUG_REPORT_URL="https://bugzilla.redhat.com/" +REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8" +REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream" diff -Nru rust-os-info-3.4.0/src/linux/tests/CentOS_Unknown/etc/centos-release rust-os-info-3.5.1/src/linux/tests/CentOS_Unknown/etc/centos-release --- rust-os-info-3.4.0/src/linux/tests/CentOS_Unknown/etc/centos-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/CentOS_Unknown/etc/centos-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1 @@ +Centos Linux diff -Nru rust-os-info-3.4.0/src/linux/tests/Fedora/etc/fedora-release rust-os-info-3.5.1/src/linux/tests/Fedora/etc/fedora-release --- rust-os-info-3.4.0/src/linux/tests/Fedora/etc/fedora-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/Fedora/etc/fedora-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1 @@ +Fedora release 26 (Twenty Six) diff -Nru rust-os-info-3.4.0/src/linux/tests/Fedora_32/etc/os-release rust-os-info-3.5.1/src/linux/tests/Fedora_32/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/Fedora_32/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/Fedora_32/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,21 @@ +NAME=Fedora +VERSION="32 (Cloud Edition)" +ID=fedora +VERSION_ID=32 +VERSION_CODENAME="" +PLATFORM_ID="platform:f32" +PRETTY_NAME="Fedora 32 (Cloud Edition)" +ANSI_COLOR="0;34" +LOGO=fedora-logo-icon +CPE_NAME="cpe:/o:fedoraproject:fedora:32" +HOME_URL="https://fedoraproject.org/" +DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f32/system-administrators-guide/" +SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help" +BUG_REPORT_URL="https://bugzilla.redhat.com/" +REDHAT_BUGZILLA_PRODUCT="Fedora" +REDHAT_BUGZILLA_PRODUCT_VERSION=32 +REDHAT_SUPPORT_PRODUCT="Fedora" +REDHAT_SUPPORT_PRODUCT_VERSION=32 +PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy" +VARIANT="Cloud Edition" +VARIANT_ID=cloud diff -Nru rust-os-info-3.4.0/src/linux/tests/Fedora_35/etc/os-release rust-os-info-3.5.1/src/linux/tests/Fedora_35/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/Fedora_35/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/Fedora_35/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,21 @@ +NAME="Fedora Linux" +VERSION="35 (Workstation Edition)" +ID=fedora +VERSION_ID=35 +VERSION_CODENAME="" +PLATFORM_ID="platform:f35" +PRETTY_NAME="Fedora Linux 35 (Workstation Edition)" +ANSI_COLOR="0;38;2;60;110;180" +LOGO=fedora-logo-icon +CPE_NAME="cpe:/o:fedoraproject:fedora:35" +HOME_URL="https://fedoraproject.org/" +DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f35/system-administrators-guide/" +SUPPORT_URL="https://ask.fedoraproject.org/" +BUG_REPORT_URL="https://bugzilla.redhat.com/" +REDHAT_BUGZILLA_PRODUCT="Fedora" +REDHAT_BUGZILLA_PRODUCT_VERSION=35 +REDHAT_SUPPORT_PRODUCT="Fedora" +REDHAT_SUPPORT_PRODUCT_VERSION=35 +PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy" +VARIANT="Workstation Edition" +VARIANT_ID=workstation diff -Nru rust-os-info-3.4.0/src/linux/tests/fedora-release rust-os-info-3.5.1/src/linux/tests/fedora-release --- rust-os-info-3.4.0/src/linux/tests/fedora-release 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/fedora-release 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fedora release 26 (Twenty Six) diff -Nru rust-os-info-3.4.0/src/linux/tests/Fedora_Unknown/etc/fedora-release rust-os-info-3.5.1/src/linux/tests/Fedora_Unknown/etc/fedora-release --- rust-os-info-3.4.0/src/linux/tests/Fedora_Unknown/etc/fedora-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/Fedora_Unknown/etc/fedora-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1 @@ +Fedora (Foo Bar) diff -Nru rust-os-info-3.4.0/src/linux/tests/Mariner/etc/mariner-release rust-os-info-3.5.1/src/linux/tests/Mariner/etc/mariner-release --- rust-os-info-3.4.0/src/linux/tests/Mariner/etc/mariner-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/Mariner/etc/mariner-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,2 @@ +CBL-Mariner 2.0.20220210 +MARINER_BUILD_NUMBER=0d11c66 diff -Nru rust-os-info-3.4.0/src/linux/tests/mariner-release rust-os-info-3.5.1/src/linux/tests/mariner-release --- rust-os-info-3.4.0/src/linux/tests/mariner-release 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/mariner-release 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -CBL-Mariner 2.0.20220210 -MARINER_BUILD_NUMBER=0d11c66 diff -Nru rust-os-info-3.4.0/src/linux/tests/Mariner_Unknown/etc/mariner-release rust-os-info-3.5.1/src/linux/tests/Mariner_Unknown/etc/mariner-release --- rust-os-info-3.4.0/src/linux/tests/Mariner_Unknown/etc/mariner-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/Mariner_Unknown/etc/mariner-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1 @@ +CBL-Mariner \ No newline at end of file diff -Nru rust-os-info-3.4.0/src/linux/tests/Mint/etc/os-release rust-os-info-3.5.1/src/linux/tests/Mint/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/Mint/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/Mint/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,12 @@ +NAME="Linux Mint" +VERSION="20 (Ulyana)" +ID=linuxmint +ID_LIKE=ubuntu +PRETTY_NAME="Linux Mint 20" +VERSION_ID="20" +HOME_URL="https://www.linuxmint.com/" +SUPPORT_URL="https://forums.linuxmint.com/" +BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/" +PRIVACY_POLICY_URL="https://www.linuxmint.com/" +VERSION_CODENAME=ulyana +UBUNTU_CODENAME=focal diff -Nru rust-os-info-3.4.0/src/linux/tests/NixOS/etc/os-release rust-os-info-3.5.1/src/linux/tests/NixOS/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/NixOS/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/NixOS/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,11 @@ +NAME=NixOS +ID=nixos +VERSION="21.05pre275822.916ee862e87 (Okapi)" +VERSION_CODENAME=okapi +VERSION_ID="21.05pre275822.916ee862e87" +PRETTY_NAME="NixOS 21.05 (Okapi)" +LOGO="nix-snowflake" +HOME_URL="https://nixos.org/" +DOCUMENTATION_URL="https://nixos.org/learn.html" +SUPPORT_URL="https://nixos.org/community.html" +BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues" diff -Nru rust-os-info-3.4.0/src/linux/tests/none_invalid_os_release/etc/os-release rust-os-info-3.5.1/src/linux/tests/none_invalid_os_release/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/none_invalid_os_release/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/none_invalid_os_release/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,2 @@ +ID="Lorem ipsum dolor sit amet" +VERSION_ID="It's all greek to me" diff -Nru rust-os-info-3.4.0/src/linux/tests/OracleLinux/etc/os-release rust-os-info-3.5.1/src/linux/tests/OracleLinux/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/OracleLinux/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/OracleLinux/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,18 @@ +NAME="Oracle Linux Server" +VERSION="8.1" +ID="ol" +ID_LIKE="fedora" +VARIANT="Server" +VARIANT_ID="server" +VERSION_ID="8.1" +PLATFORM_ID="platform:el8" +PRETTY_NAME="Oracle Linux Server 8.1" +ANSI_COLOR="0;31" +CPE_NAME="cpe:/o:oracle:linux:8:1:server" +HOME_URL="https://linux.oracle.com/" +BUG_REPORT_URL="https://bugzilla.oracle.com/" + +ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8" +ORACLE_BUGZILLA_PRODUCT_VERSION=8.1 +ORACLE_SUPPORT_PRODUCT="Oracle Linux" +ORACLE_SUPPORT_PRODUCT_VERSION=8.1 diff -Nru rust-os-info-3.4.0/src/linux/tests/OracleLinux/etc/redhat-release rust-os-info-3.5.1/src/linux/tests/OracleLinux/etc/redhat-release --- rust-os-info-3.4.0/src/linux/tests/OracleLinux/etc/redhat-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/OracleLinux/etc/redhat-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1 @@ +Redhat Linux release XX \ No newline at end of file diff -Nru rust-os-info-3.4.0/src/linux/tests/os-release rust-os-info-3.5.1/src/linux/tests/os-release --- rust-os-info-3.4.0/src/linux/tests/os-release 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/os-release 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -NAME="Oracle Linux Server" -VERSION="8.1" -ID="ol" -ID_LIKE="fedora" -VARIANT="Server" -VARIANT_ID="server" -VERSION_ID="8.1" -PLATFORM_ID="platform:el8" -PRETTY_NAME="Oracle Linux Server 8.1" -ANSI_COLOR="0;31" -CPE_NAME="cpe:/o:oracle:linux:8:1:server" -HOME_URL="https://linux.oracle.com/" -BUG_REPORT_URL="https://bugzilla.oracle.com/" - -ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8" -ORACLE_BUGZILLA_PRODUCT_VERSION=8.1 -ORACLE_SUPPORT_PRODUCT="Oracle Linux" -ORACLE_SUPPORT_PRODUCT_VERSION=8.1 diff -Nru rust-os-info-3.4.0/src/linux/tests/os-release-alpine-3-12 rust-os-info-3.5.1/src/linux/tests/os-release-alpine-3-12 --- rust-os-info-3.4.0/src/linux/tests/os-release-alpine-3-12 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/os-release-alpine-3-12 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -NAME="Alpine Linux" -ID=alpine -VERSION_ID=3.12.0 -PRETTY_NAME="Alpine Linux v3.12" -HOME_URL="https://alpinelinux.org/" -BUG_REPORT_URL="https://bugs.alpinelinux.org/" diff -Nru rust-os-info-3.4.0/src/linux/tests/os-release-amazon-1 rust-os-info-3.5.1/src/linux/tests/os-release-amazon-1 --- rust-os-info-3.4.0/src/linux/tests/os-release-amazon-1 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/os-release-amazon-1 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -NAME="Amazon Linux AMI" -VERSION="2018.03" -ID="amzn" -ID_LIKE="rhel fedora" -VERSION_ID="2018.03" -PRETTY_NAME="Amazon Linux AMI 2018.03" -ANSI_COLOR="0;33" -CPE_NAME="cpe:/o:amazon:linux:2018.03:ga" -HOME_URL="http://aws.amazon.com/amazon-linux-ami/" diff -Nru rust-os-info-3.4.0/src/linux/tests/os-release-amazon-2 rust-os-info-3.5.1/src/linux/tests/os-release-amazon-2 --- rust-os-info-3.4.0/src/linux/tests/os-release-amazon-2 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/os-release-amazon-2 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -NAME="Amazon Linux" -VERSION="2" -ID="amzn" -ID_LIKE="centos rhel fedora" -VERSION_ID="2" -PRETTY_NAME="Amazon Linux 2" -ANSI_COLOR="0;33" -CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2" -HOME_URL="https://amazonlinux.com/" diff -Nru rust-os-info-3.4.0/src/linux/tests/os-release-centos rust-os-info-3.5.1/src/linux/tests/os-release-centos --- rust-os-info-3.4.0/src/linux/tests/os-release-centos 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/os-release-centos 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -NAME="CentOS Linux" -VERSION="7 (Core)" -ID="centos" -ID_LIKE="rhel fedora" -VERSION_ID="7" -PRETTY_NAME="CentOS Linux 7 (Core)" -ANSI_COLOR="0;31" -CPE_NAME="cpe:/o:centos:centos:7" -HOME_URL="https://www.centos.org/" -BUG_REPORT_URL="https://bugs.centos.org/" - -CENTOS_MANTISBT_PROJECT="CentOS-7" -CENTOS_MANTISBT_PROJECT_VERSION="7" -REDHAT_SUPPORT_PRODUCT="centos" -REDHAT_SUPPORT_PRODUCT_VERSION="7" diff -Nru rust-os-info-3.4.0/src/linux/tests/os-release-centos-stream rust-os-info-3.5.1/src/linux/tests/os-release-centos-stream --- rust-os-info-3.4.0/src/linux/tests/os-release-centos-stream 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/os-release-centos-stream 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -NAME="CentOS Stream" -VERSION="8" -ID="centos" -ID_LIKE="rhel fedora" -VERSION_ID="8" -PLATFORM_ID="platform:el8" -PRETTY_NAME="CentOS Stream 8" -ANSI_COLOR="0;31" -CPE_NAME="cpe:/o:centos:centos:8" -HOME_URL="https://centos.org/" -BUG_REPORT_URL="https://bugzilla.redhat.com/" -REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8" -REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream" diff -Nru rust-os-info-3.4.0/src/linux/tests/os-release-fedora-32 rust-os-info-3.5.1/src/linux/tests/os-release-fedora-32 --- rust-os-info-3.4.0/src/linux/tests/os-release-fedora-32 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/os-release-fedora-32 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -NAME=Fedora -VERSION="32 (Cloud Edition)" -ID=fedora -VERSION_ID=32 -VERSION_CODENAME="" -PLATFORM_ID="platform:f32" -PRETTY_NAME="Fedora 32 (Cloud Edition)" -ANSI_COLOR="0;34" -LOGO=fedora-logo-icon -CPE_NAME="cpe:/o:fedoraproject:fedora:32" -HOME_URL="https://fedoraproject.org/" -DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f32/system-administrators-guide/" -SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help" -BUG_REPORT_URL="https://bugzilla.redhat.com/" -REDHAT_BUGZILLA_PRODUCT="Fedora" -REDHAT_BUGZILLA_PRODUCT_VERSION=32 -REDHAT_SUPPORT_PRODUCT="Fedora" -REDHAT_SUPPORT_PRODUCT_VERSION=32 -PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy" -VARIANT="Cloud Edition" -VARIANT_ID=cloud diff -Nru rust-os-info-3.4.0/src/linux/tests/os-release-fedora-35 rust-os-info-3.5.1/src/linux/tests/os-release-fedora-35 --- rust-os-info-3.4.0/src/linux/tests/os-release-fedora-35 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/os-release-fedora-35 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -NAME="Fedora Linux" -VERSION="35 (Workstation Edition)" -ID=fedora -VERSION_ID=35 -VERSION_CODENAME="" -PLATFORM_ID="platform:f35" -PRETTY_NAME="Fedora Linux 35 (Workstation Edition)" -ANSI_COLOR="0;38;2;60;110;180" -LOGO=fedora-logo-icon -CPE_NAME="cpe:/o:fedoraproject:fedora:35" -HOME_URL="https://fedoraproject.org/" -DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f35/system-administrators-guide/" -SUPPORT_URL="https://ask.fedoraproject.org/" -BUG_REPORT_URL="https://bugzilla.redhat.com/" -REDHAT_BUGZILLA_PRODUCT="Fedora" -REDHAT_BUGZILLA_PRODUCT_VERSION=35 -REDHAT_SUPPORT_PRODUCT="Fedora" -REDHAT_SUPPORT_PRODUCT_VERSION=35 -PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy" -VARIANT="Workstation Edition" -VARIANT_ID=workstation diff -Nru rust-os-info-3.4.0/src/linux/tests/os-release-mint rust-os-info-3.5.1/src/linux/tests/os-release-mint --- rust-os-info-3.4.0/src/linux/tests/os-release-mint 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/os-release-mint 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -NAME="Linux Mint" -VERSION="20 (Ulyana)" -ID=linuxmint -ID_LIKE=ubuntu -PRETTY_NAME="Linux Mint 20" -VERSION_ID="20" -HOME_URL="https://www.linuxmint.com/" -SUPPORT_URL="https://forums.linuxmint.com/" -BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/" -PRIVACY_POLICY_URL="https://www.linuxmint.com/" -VERSION_CODENAME=ulyana -UBUNTU_CODENAME=focal diff -Nru rust-os-info-3.4.0/src/linux/tests/os-release-nixos rust-os-info-3.5.1/src/linux/tests/os-release-nixos --- rust-os-info-3.4.0/src/linux/tests/os-release-nixos 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/os-release-nixos 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -NAME=NixOS -ID=nixos -VERSION="21.05pre275822.916ee862e87 (Okapi)" -VERSION_CODENAME=okapi -VERSION_ID="21.05pre275822.916ee862e87" -PRETTY_NAME="NixOS 21.05 (Okapi)" -LOGO="nix-snowflake" -HOME_URL="https://nixos.org/" -DOCUMENTATION_URL="https://nixos.org/learn.html" -SUPPORT_URL="https://nixos.org/community.html" -BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues" diff -Nru rust-os-info-3.4.0/src/linux/tests/os-release-rhel rust-os-info-3.5.1/src/linux/tests/os-release-rhel --- rust-os-info-3.4.0/src/linux/tests/os-release-rhel 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/os-release-rhel 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -NAME="Red Hat Enterprise Linux" -VERSION="8.2 (Ootpa)" -ID="rhel" -ID_LIKE="fedora" -VERSION_ID="8.2" -PLATFORM_ID="platform:el8" -PRETTY_NAME="Red Hat Enterprise Linux 8.2 (Ootpa)" -ANSI_COLOR="0;31" -CPE_NAME="cpe:/o:redhat:enterprise_linux:8.2:GA" -HOME_URL="https://www.redhat.com/" -BUG_REPORT_URL="https://bugzilla.redhat.com/" - -REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8" -REDHAT_BUGZILLA_PRODUCT_VERSION=8.2 -REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" -REDHAT_SUPPORT_PRODUCT_VERSION="8.2" diff -Nru rust-os-info-3.4.0/src/linux/tests/os-release-suse-12 rust-os-info-3.5.1/src/linux/tests/os-release-suse-12 --- rust-os-info-3.4.0/src/linux/tests/os-release-suse-12 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/os-release-suse-12 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -NAME="SLES" -VERSION="12-SP5" -VERSION_ID="12.5" -PRETTY_NAME="SUSE Linux Enterprise Server 12 SP5" -ID="sles" -ANSI_COLOR="0;32" -CPE_NAME="cpe:/o:suse:sles:12:sp5" diff -Nru rust-os-info-3.4.0/src/linux/tests/os-release-suse-15 rust-os-info-3.5.1/src/linux/tests/os-release-suse-15 --- rust-os-info-3.4.0/src/linux/tests/os-release-suse-15 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/os-release-suse-15 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -NAME="SLES" -VERSION="15-SP2" -VERSION_ID="15.2" -PRETTY_NAME="SUSE Linux Enterprise Server 15 SP2" -ID="sles" -ID_LIKE="suse" -ANSI_COLOR="0;32" -CPE_NAME="cpe:/o:suse:sles:15:sp2" diff -Nru rust-os-info-3.4.0/src/linux/tests/os-release-ubuntu rust-os-info-3.5.1/src/linux/tests/os-release-ubuntu --- rust-os-info-3.4.0/src/linux/tests/os-release-ubuntu 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/os-release-ubuntu 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -NAME="Ubuntu" -VERSION="18.10 (Cosmic Cuttlefish)" -ID=ubuntu -ID_LIKE=debian -PRETTY_NAME="Ubuntu 18.10" -VERSION_ID="18.10" -HOME_URL="https://www.ubuntu.com/" -SUPPORT_URL="https://help.ubuntu.com/" -BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" -PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" -VERSION_CODENAME=cosmic -UBUNTU_CODENAME=cosmic diff -Nru rust-os-info-3.4.0/src/linux/tests/RedHatEnterprise/etc/redhat-release rust-os-info-3.5.1/src/linux/tests/RedHatEnterprise/etc/redhat-release --- rust-os-info-3.4.0/src/linux/tests/RedHatEnterprise/etc/redhat-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/RedHatEnterprise/etc/redhat-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1 @@ +Redhat Linux release XX diff -Nru rust-os-info-3.4.0/src/linux/tests/RedHatEnterprise_7/etc/os-release rust-os-info-3.5.1/src/linux/tests/RedHatEnterprise_7/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/RedHatEnterprise_7/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/RedHatEnterprise_7/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,17 @@ +NAME="Red Hat Enterprise Linux Server" +VERSION="7.9 (Maipo)" +ID="rhel" +ID_LIKE="fedora" +VARIANT="Server" +VARIANT_ID="server" +VERSION_ID="7.9" +PRETTY_NAME="Red Hat Enterprise Linux Server 7.9 (Maipo)" +ANSI_COLOR="0;31" +CPE_NAME="cpe:/o:redhat:enterprise_linux:7.9:GA:server" +HOME_URL="https://www.redhat.com/" +BUG_REPORT_URL="https://bugzilla.redhat.com/" + +REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7" +REDHAT_BUGZILLA_PRODUCT_VERSION=7.9 +REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" +REDHAT_SUPPORT_PRODUCT_VERSION="7.9" diff -Nru rust-os-info-3.4.0/src/linux/tests/RedHatEnterprise_8/etc/os-release rust-os-info-3.5.1/src/linux/tests/RedHatEnterprise_8/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/RedHatEnterprise_8/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/RedHatEnterprise_8/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,16 @@ +NAME="Red Hat Enterprise Linux" +VERSION="8.2 (Ootpa)" +ID="rhel" +ID_LIKE="fedora" +VERSION_ID="8.2" +PLATFORM_ID="platform:el8" +PRETTY_NAME="Red Hat Enterprise Linux 8.2 (Ootpa)" +ANSI_COLOR="0;31" +CPE_NAME="cpe:/o:redhat:enterprise_linux:8.2:GA" +HOME_URL="https://www.redhat.com/" +BUG_REPORT_URL="https://bugzilla.redhat.com/" + +REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8" +REDHAT_BUGZILLA_PRODUCT_VERSION=8.2 +REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" +REDHAT_SUPPORT_PRODUCT_VERSION="8.2" diff -Nru rust-os-info-3.4.0/src/linux/tests/redhat-release rust-os-info-3.5.1/src/linux/tests/redhat-release --- rust-os-info-3.4.0/src/linux/tests/redhat-release 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/redhat-release 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Redhat Linux release XX diff -Nru rust-os-info-3.4.0/src/linux/tests/SUSE_12/etc/os-release rust-os-info-3.5.1/src/linux/tests/SUSE_12/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/SUSE_12/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/SUSE_12/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,7 @@ +NAME="SLES" +VERSION="12-SP5" +VERSION_ID="12.5" +PRETTY_NAME="SUSE Linux Enterprise Server 12 SP5" +ID="sles" +ANSI_COLOR="0;32" +CPE_NAME="cpe:/o:suse:sles:12:sp5" diff -Nru rust-os-info-3.4.0/src/linux/tests/SUSE_15/etc/os-release rust-os-info-3.5.1/src/linux/tests/SUSE_15/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/SUSE_15/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/SUSE_15/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,8 @@ +NAME="SLES" +VERSION="15-SP2" +VERSION_ID="15.2" +PRETTY_NAME="SUSE Linux Enterprise Server 15 SP2" +ID="sles" +ID_LIKE="suse" +ANSI_COLOR="0;32" +CPE_NAME="cpe:/o:suse:sles:15:sp2" diff -Nru rust-os-info-3.4.0/src/linux/tests/Ubuntu/etc/os-release rust-os-info-3.5.1/src/linux/tests/Ubuntu/etc/os-release --- rust-os-info-3.4.0/src/linux/tests/Ubuntu/etc/os-release 1970-01-01 00:00:00.000000000 +0000 +++ rust-os-info-3.5.1/src/linux/tests/Ubuntu/etc/os-release 2006-07-24 01:21:28.000000000 +0000 @@ -0,0 +1,12 @@ +NAME="Ubuntu" +VERSION="18.10 (Cosmic Cuttlefish)" +ID=ubuntu +ID_LIKE=debian +PRETTY_NAME="Ubuntu 18.10" +VERSION_ID="18.10" +HOME_URL="https://www.ubuntu.com/" +SUPPORT_URL="https://help.ubuntu.com/" +BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" +PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" +VERSION_CODENAME=cosmic +UBUNTU_CODENAME=cosmic diff -Nru rust-os-info-3.4.0/src/matcher.rs rust-os-info-3.5.1/src/matcher.rs --- rust-os-info-3.4.0/src/matcher.rs 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/matcher.rs 2006-07-24 01:21:28.000000000 +0000 @@ -33,10 +33,8 @@ fn find_by_key<'a>(string: &'a str, key: &str) -> Option<&'a str> { let key = [key, "="].concat(); for line in string.lines() { - if let Some(key_start) = line.find(&key) { - return Some( - line[key_start + key.len()..].trim_matches(|c: char| c == '"' || c.is_whitespace()), - ); + if line.starts_with(&key) { + return Some(line[key.len()..].trim_matches(|c: char| c == '"' || c.is_whitespace())); } } diff -Nru rust-os-info-3.4.0/src/os_type.rs rust-os-info-3.5.1/src/os_type.rs --- rust-os-info-3.4.0/src/os_type.rs 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/os_type.rs 2006-07-24 01:21:28.000000000 +0000 @@ -28,13 +28,15 @@ Fedora, /// FreeBSD (). FreeBSD, + /// Garuda Linux () + Garuda, /// Gentoo Linux (). Gentoo, - /// Linux based operating system (). + /// HardenedBSD (https://hardenedbsd.org/). HardenedBSD, - /// HardenedBSD (https://hardenedbsd.org/) + /// Illumos (https://en.wikipedia.org/wiki/Illumos). Illumos, - /// Illumos (https://en.wikipedia.org/wiki/Illumos) + /// Linux based operating system (). Linux, /// Mac OS X/OS X/macOS (). Macos, @@ -42,9 +44,9 @@ Manjaro, /// Mariner (). Mariner, - /// Mint (). + /// MidnightBSD (). MidnightBSD, - /// MidnightBSD(). + /// Mint (). Mint, /// NetBSD (). NetBSD, @@ -91,6 +93,7 @@ Type::Amazon => write!(f, "Amazon Linux AMI"), Type::Arch => write!(f, "Arch Linux"), Type::DragonFly => write!(f, "DragonFly BSD"), + Type::Garuda => write!(f, "Garuda Linux"), Type::Gentoo => write!(f, "Gentoo Linux"), Type::Illumos => write!(f, "illumos"), Type::Macos => write!(f, "Mac OS"), @@ -128,6 +131,7 @@ (Type::Emscripten, "Emscripten"), (Type::EndeavourOS, "EndeavourOS"), (Type::Fedora, "Fedora"), + (Type::Garuda, "Garuda Linux"), (Type::Gentoo, "Gentoo Linux"), (Type::FreeBSD, "FreeBSD"), (Type::Linux, "Linux"), diff -Nru rust-os-info-3.4.0/src/windows/winapi.rs rust-os-info-3.5.1/src/windows/winapi.rs --- rust-os-info-3.4.0/src/windows/winapi.rs 1973-11-29 21:33:09.000000000 +0000 +++ rust-os-info-3.5.1/src/windows/winapi.rs 2006-07-24 01:21:28.000000000 +0000 @@ -59,7 +59,7 @@ v.dwMinorVersion as u64, v.dwBuildNumber as u64, ), - product_name().or_else(|| edition(&v)), + product_name(&v).or_else(|| edition(&v)), ), } } @@ -125,7 +125,7 @@ } } -fn product_name() -> Option { +fn product_name(info: &OSVERSIONINFOEX) -> Option { const REG_SUCCESS: LSTATUS = ERROR_SUCCESS as LSTATUS; let sub_key = to_wide("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"); @@ -138,8 +138,14 @@ return None; } + let is_win_11 = info.dwMajorVersion == 10 && info.dwBuildNumber >= 22000; + // Get size of the data. - let name = to_wide("ProductName"); + let name = to_wide(if is_win_11 { + "EditionID" + } else { + "ProductName" + }); let mut data_type: DWORD = 0; let mut data_size: DWORD = 0; if unsafe { @@ -186,11 +192,15 @@ _ => {} } - Some( - OsString::from_wide(data.as_slice()) - .to_string_lossy() - .into_owned(), - ) + let value = OsString::from_wide(data.as_slice()) + .to_string_lossy() + .into_owned(); + + if is_win_11 { + Some(format!("Windows 11 {}", value)) + } else { + Some(value) + } } fn to_wide(value: &str) -> Vec { @@ -206,7 +216,13 @@ version_info.wProductType, ) { // Windows 10. - (10, 0, VER_NT_WORKSTATION) => Some("Windows 10"), + (10, 0, VER_NT_WORKSTATION) => { + if version_info.dwBuildNumber >= 22000 { + Some("Windows 11") + } else { + Some("Windows 10") + } + } (10, 0, _) => Some("Windows Server 2016"), // Windows Vista, 7, 8 and 8.1. (6, 3, VER_NT_WORKSTATION) => Some("Windows 8.1"), @@ -283,7 +299,6 @@ #[test] fn get_edition() { let test_data = [ - (10, 0, VER_NT_WORKSTATION, "Windows 10"), (10, 0, 0, "Windows Server 2016"), (6, 3, VER_NT_WORKSTATION, "Windows 8.1"), (6, 3, 0, "Windows Server 2012 R2"), @@ -351,7 +366,8 @@ #[test] fn get_product_name() { - let edition = product_name().expect("edition() failed"); + let version = version_info().expect("version_info() failed"); + let edition = product_name(&version).expect("edition() failed"); assert!(!edition.is_empty()); }