From bfac2091ba0e572a04aeabb6811cb747a1242a63 Mon Sep 17 00:00:00 2001 From: Stanislav Tkach Date: Fri, 29 Nov 2024 18:29:28 +0100 Subject: [PATCH] Release the 3.9.0 version --- CHANGELOG.md | 80 ++++++++++++++++++++++++++++---- README.md | 3 ++ cli/Cargo.toml | 2 +- os_info/Cargo.toml | 4 +- os_info/src/linux/lsb_release.rs | 5 +- os_info/src/os_type.rs | 8 ++-- 6 files changed, 84 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bf5e2a..eb8fec9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +## [3.9.0] (2024-11-30) + +- Nobara Linux support has been added. (#379) + +- UOS support has been added. (#380) + +- Fix `uname` usage on AIX. (#381) + +- CachyOS support has been added. (#386) + ## [3.8.2] (2024-03-22) - Build on FreeSBD has been fixed once again. (#377) @@ -145,11 +155,11 @@ All notable changes to this project will be documented in this file. - Linux Mint support has been added. (#233) - Operating system type detection has been fixed for the following Linux distributions: - - Amazon Linux. (#225, #226) - - Red Hat Enterprise Linux. (#228) - - Suse. (#229) - - Fedora. (#230) - - Alpine Linux. (#235) + - Amazon Linux. (#225, #226) + - Red Hat Enterprise Linux. (#228) + - Suse. (#229) + - Fedora. (#230) + - Alpine Linux. (#235) - Log level for the message about the absent `lsb_release` has been reduced from `warn` to `debug`. (#237) @@ -268,7 +278,7 @@ All notable changes to this project will be documented in this file. ## [1.0.3] (2018-09-23) -- Fixed linker errors for 32-bit msvc builds. (#88) +- Fixed linker errors for 32-bit msvc builds. (#88) ## [1.0.2] (2018-09-05) @@ -329,57 +339,111 @@ All notable changes to this project will be documented in this file. ## [0.1.0] (2017-10-03) -The first release containing only minor infrastructural changes and based on [os_type](https://github.com/schultyy/os_type). +The first release containing only minor infrastructural changes and based +on [os_type](https://github.com/schultyy/os_type). + +[Unreleased]: https://github.com/stanislav-tkach/os_info/compare/v3.9.0...HEAD + +[3.9.0]: https://github.com/stanislav-tkach/os_info/compare/v3.8.2...v3.9.0 -[Unreleased]: https://github.com/stanislav-tkach/os_info/compare/v3.8.2...HEAD [3.8.1]: https://github.com/stanislav-tkach/os_info/compare/v3.8.1...v3.8.2 + [3.8.1]: https://github.com/stanislav-tkach/os_info/compare/v3.8.0...v3.8.1 + [3.8.0]: https://github.com/stanislav-tkach/os_info/compare/v3.7.0...v3.8.0 + [3.7.0]: https://github.com/stanislav-tkach/os_info/compare/v3.6.0...v3.7.0 + [3.6.0]: https://github.com/stanislav-tkach/os_info/compare/v3.5.1...v3.6.0 + [3.5.1]: https://github.com/stanislav-tkach/os_info/compare/v3.5.0...v3.5.1 + [3.5.0]: https://github.com/stanislav-tkach/os_info/compare/v3.4.0...v3.5.0 + [3.4.0]: https://github.com/stanislav-tkach/os_info/compare/v3.3.0...v3.4.0 + [3.3.0]: https://github.com/stanislav-tkach/os_info/compare/v3.2.0...v3.3.0 + [3.2.0]: https://github.com/stanislav-tkach/os_info/compare/v3.1.0...v3.2.0 + [3.1.0]: https://github.com/stanislav-tkach/os_info/compare/v3.0.9...v3.1.0 + [3.0.9]: https://github.com/stanislav-tkach/os_info/compare/v3.0.8...v3.0.9 + [3.0.8]: https://github.com/stanislav-tkach/os_info/compare/v3.0.7...v3.0.8 + [3.0.7]: https://github.com/stanislav-tkach/os_info/compare/v3.0.6...v3.0.7 + [3.0.6]: https://github.com/stanislav-tkach/os_info/compare/v3.0.5...v3.0.6 + [3.0.5]: https://github.com/stanislav-tkach/os_info/compare/v3.0.4...v3.0.5 + [3.0.4]: https://github.com/stanislav-tkach/os_info/compare/v3.0.3...v3.0.4 + [3.0.3]: https://github.com/stanislav-tkach/os_info/compare/v3.0.2...v3.0.3 + [3.0.2]: https://github.com/stanislav-tkach/os_info/compare/v3.0.1...v3.0.2 + [3.0.1]: https://github.com/stanislav-tkach/os_info/compare/v3.0...v3.0.1 + [3.0.0]: https://github.com/stanislav-tkach/os_info/compare/v2.0.8...v3.0 + [2.0.8]: https://github.com/stanislav-tkach/os_info/compare/v2.0.7...v2.0.8 + [2.0.7]: https://github.com/stanislav-tkach/os_info/compare/v2.0.6...v2.0.7 + [2.0.6]: https://github.com/stanislav-tkach/os_info/compare/2.0.5...v2.0.6 + [2.0.5]: https://github.com/stanislav-tkach/os_info/compare/2.0.4...2.0.5 + [2.0.4]: https://github.com/stanislav-tkach/os_info/compare/v2.0.3...2.0.4 + [2.0.3]: https://github.com/stanislav-tkach/os_info/compare/v2.0.2...v2.0.3 + [2.0.2]: https://github.com/stanislav-tkach/os_info/compare/v2.0.1...v2.0.2 + [2.0.1]: https://github.com/stanislav-tkach/os_info/compare/v2.0...v2.0.1 + [2.0.0]: https://github.com/stanislav-tkach/os_info/compare/v1.3.3...v2.0 + [1.3.3]: https://github.com/stanislav-tkach/os_info/compare/v1.3.2...v1.3.3 + [1.3.2]: https://github.com/stanislav-tkach/os_info/compare/v1.3.1...v1.3.2 + [1.3.1]: https://github.com/stanislav-tkach/os_info/compare/v1.3...v1.3.1 + [1.3.0]: https://github.com/stanislav-tkach/os_info/compare/v1.2...v1.3 + [1.2.0]: https://github.com/stanislav-tkach/os_info/compare/v1.1.3...v1.2 + [1.1.3]: https://github.com/stanislav-tkach/os_info/compare/v1.1.2...v1.1.3 + [1.1.2]: https://github.com/stanislav-tkach/os_info/compare/v1.1.1...v1.1.2 + [1.1.1]: https://github.com/stanislav-tkach/os_info/compare/v1.1...v1.1.1 + [1.1.0]: https://github.com/stanislav-tkach/os_info/compare/v1.0.3...v1.1 + [1.0.3]: https://github.com/stanislav-tkach/os_info/compare/v1.0.2...v1.0.3 + [1.0.2]: https://github.com/stanislav-tkach/os_info/compare/v1.0.1...v1.0.2 + [1.0.1]: https://github.com/stanislav-tkach/os_info/compare/v1.0.1...v1.0.2 + [1.0.0]: https://github.com/stanislav-tkach/os_info/compare/v0.7.0...v1.0 + [0.7.0]: https://github.com/stanislav-tkach/os_info/compare/v0.6.0...v0.7.0 + [0.6.0]: https://github.com/stanislav-tkach/os_info/compare/v0.5.0...v0.6.0 + [0.5.0]: https://github.com/stanislav-tkach/os_info/compare/v0.4.0...v0.5.0 + [0.4.0]: https://github.com/stanislav-tkach/os_info/compare/v0.3.0...v0.4.0 + [0.3.0]: https://github.com/stanislav-tkach/os_info/compare/v0.2.0...v0.3.0 + [0.2.0]: https://github.com/stanislav-tkach/os_info/compare/v.0.1.1...v0.2.0 + [0.1.1]: https://github.com/stanislav-tkach/os_info/compare/v0.1.0...v.0.1.1 + [0.1.0]: https://github.com/stanislav-tkach/os_info/tree/v0.1.0 diff --git a/README.md b/README.md index a87dcd0..0420e6c 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ Right now, the following operating system types can be returned: - Android - Arch Linux - Artix Linux +- CachyOS - CentOS - Debian - DragonFly BSD @@ -108,6 +109,7 @@ Right now, the following operating system types can be returned: - Mint - NetBSD - NixOS +- Nobara Linux - OpenBSD - OpenCloudOS - openEuler (EulerOS) @@ -134,4 +136,5 @@ If you need support for more OS types, I am looking forward to your Pull Request `os_info` is licensed under the MIT license. See [LICENSE] for the details. [lsb_release]: http://refspecs.linuxbase.org/LSB_2.0.1/LSB-PDA/LSB-PDA/lsbrelease.html + [LICENSE]: https://github.com/stanislav-tkach/os_info/blob/master/LICENSE diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 37e4aa2..b5fbfdd 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -18,7 +18,7 @@ name = "os_info" path = "src/main.rs" [dependencies] -os_info = { version = "3.8.2", default-features = false, path = "../os_info" } +os_info = { version = "3.9.0", default-features = false, path = "../os_info" } log.workspace = true env_logger = "0.11" clap = { version = "4", features = ["derive"] } diff --git a/os_info/Cargo.toml b/os_info/Cargo.toml index 11dd9b3..89bcfc9 100644 --- a/os_info/Cargo.toml +++ b/os_info/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "os_info" -version = "3.8.2" +version = "3.9.0" authors = ["Jan Schulte ", "Stanislav Tkach "] description = "Detect the operating system type and version." documentation = "https://docs.rs/os_info" @@ -29,7 +29,7 @@ windows-sys = { version = "0.52", features = [ "Win32_System_SystemServices", "Win32_System_Threading", "Win32_UI_WindowsAndMessaging", -]} +] } [dev-dependencies] pretty_assertions = "1" diff --git a/os_info/src/linux/lsb_release.rs b/os_info/src/linux/lsb_release.rs index 232ea22..2999540 100644 --- a/os_info/src/linux/lsb_release.rs +++ b/os_info/src/linux/lsb_release.rs @@ -67,7 +67,7 @@ struct LsbRelease { fn retrieve() -> Option { match Command::new("lsb_release").arg("-a").output() { Ok(output) => { - trace!("lsb_release command returned {:?}", output); //日志信息 + trace!("lsb_release command returned {:?}", output); Some(parse(&String::from_utf8_lossy(&output.stdout))) } Err(e) => { @@ -77,7 +77,6 @@ fn retrieve() -> Option { } } -// 解析 fn parse(output: &str) -> LsbRelease { trace!("Trying to parse {:?}", output); @@ -360,7 +359,7 @@ mod tests { #[test] fn cachyos() { - let parse_results = parse(&cachyos_file()); + let parse_results = parse(cachyos_file()); assert_eq!(parse_results.distribution, Some("cachyos".to_string())); assert_eq!(parse_results.version, Some("rolling".to_string())); } diff --git a/os_info/src/os_type.rs b/os_info/src/os_type.rs index 2b89622..dc5baad 100644 --- a/os_info/src/os_type.rs +++ b/os_info/src/os_type.rs @@ -68,8 +68,6 @@ pub enum Type { NixOS, /// Nobara (). Nobara, - /// Uos (). - Uos, /// OpenBSD (). OpenBSD, /// OpenCloudOS (). @@ -100,6 +98,8 @@ pub enum Type { Ubuntu, /// Ultramarine (). Ultramarine, + /// Uos (). + Uos, /// Void Linux (). Void, /// Unknown operating system. @@ -133,7 +133,6 @@ impl Display for Type { Type::MidnightBSD => write!(f, "Midnight BSD"), Type::Mint => write!(f, "Linux Mint"), Type::Nobara => write!(f, "Nobara Linux"), - Type::Uos => write!(f, "Uos"), Type::openEuler => write!(f, "EulerOS"), Type::OracleLinux => write!(f, "Oracle Linux"), Type::Pop => write!(f, "Pop!_OS"), @@ -143,6 +142,7 @@ impl Display for Type { Type::RockyLinux => write!(f, "Rocky Linux"), Type::SUSE => write!(f, "SUSE Linux Enterprise Server"), Type::Ultramarine => write!(f, "Ultramarine Linux"), + Type::Uos => write!(f, "UOS"), Type::Void => write!(f, "Void Linux"), _ => write!(f, "{self:?}"), } @@ -192,7 +192,6 @@ mod tests { (Type::NetBSD, "NetBSD"), (Type::NixOS, "NixOS"), (Type::Nobara, "Nobara Linux"), - (Type::Uos, "Uos"), (Type::OpenCloudOS, "OpenCloudOS"), (Type::OpenBSD, "OpenBSD"), (Type::openEuler, "EulerOS"), @@ -209,6 +208,7 @@ mod tests { (Type::Ubuntu, "Ubuntu"), (Type::Ultramarine, "Ultramarine Linux"), (Type::Unknown, "Unknown"), + (Type::Uos, "UOS"), (Type::Void, "Void Linux"), (Type::Windows, "Windows"), ];