From f63ff194e003ba698d04c36ea4cb6c2ac53b23f7 Mon Sep 17 00:00:00 2001 From: Stanislav Tkach Date: Sat, 16 Mar 2024 23:03:23 +0100 Subject: [PATCH] Release the 3.8.1 version --- CHANGELOG.md | 13 ++++++++++++- cli/Cargo.toml | 2 +- os_info/Cargo.toml | 2 +- os_info/src/aix/mod.rs | 4 ++-- os_info/src/dragonfly/mod.rs | 2 +- os_info/src/freebsd/mod.rs | 11 +++-------- os_info/src/illumos/mod.rs | 15 +++------------ os_info/src/openbsd/mod.rs | 2 +- 8 files changed, 24 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 390d4bbe..1c098b30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +- Build on FreeSBD has been fixed. (#372) + +- Build on Illumos has been fixed. (#373) + +- Build on NetBSD has been fixed. (#374) + +- Few more regressions introduced in the `3.8.0` release were (hopefully) fixed. + +## [3.8.1] (2024-03-17) + ## [3.8.0] (2024-03-12) - The `windows-sys` crate instead of `winapi` is now used internally. (#341) @@ -317,7 +327,8 @@ All notable changes to this project will be documented in this file. 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.8.0...HEAD +[Unreleased]: https://github.com/stanislav-tkach/os_info/compare/v3.8.1...HEAD +[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 diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 83f47df7..28f1e45e 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.0", default-features = false, path = "../os_info" } +os_info = { version = "3.8.1", 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 12adeb85..53da7d2b 100644 --- a/os_info/Cargo.toml +++ b/os_info/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "os_info" -version = "3.8.0" +version = "3.8.1" authors = ["Jan Schulte ", "Stanislav Tkach "] description = "Detect the operating system type and version." documentation = "https://docs.rs/os_info" diff --git a/os_info/src/aix/mod.rs b/os_info/src/aix/mod.rs index b02bdca1..45f79e1f 100644 --- a/os_info/src/aix/mod.rs +++ b/os_info/src/aix/mod.rs @@ -29,9 +29,9 @@ fn get_version() -> Option { } fn get_os() -> Type { - match uname("-o") { + match uname("-o").as_deref() { Some("AIX") => Type::AIX, - None => Type::Unknown, + _ => Type::Unknown, } } diff --git a/os_info/src/dragonfly/mod.rs b/os_info/src/dragonfly/mod.rs index 63fe0e7c..97dded97 100644 --- a/os_info/src/dragonfly/mod.rs +++ b/os_info/src/dragonfly/mod.rs @@ -7,7 +7,7 @@ use crate::{bitness, uname::uname, Bitness, Info, Type, Version}; pub fn current_platform() -> Info { trace!("dragonfly::current_platform is called"); - let version = uname() + let version = uname("-r") .map(Version::from_string) .unwrap_or_else(|| Version::Unknown); diff --git a/os_info/src/freebsd/mod.rs b/os_info/src/freebsd/mod.rs index ddafb5ae..d0cf862d 100644 --- a/os_info/src/freebsd/mod.rs +++ b/os_info/src/freebsd/mod.rs @@ -24,12 +24,7 @@ pub fn current_platform() -> Info { } fn get_os() -> Type { - let os = match uname("-s") { - Some(o) => o, - None => return Type::Unknown, - }; - - match os.as_str() { + match uname("-s").as_deref() { "MidnightBSD" => Type::MidnightBSD, "FreeBSD" => { let check_hardening = match Command::new("/sbin/sysctl") @@ -47,8 +42,8 @@ fn get_os() -> Type { Ok(_) => Type::FreeBSD, Err(_) => Type::FreeBSD, } - }, - _ => Type::Unknown + } + _ => Type::Unknown, } } diff --git a/os_info/src/illumos/mod.rs b/os_info/src/illumos/mod.rs index 4fb0cfb8..1d6a7d29 100644 --- a/os_info/src/illumos/mod.rs +++ b/os_info/src/illumos/mod.rs @@ -8,7 +8,7 @@ use crate::{bitness, uname::uname, Info, Type, Version}; pub fn current_platform() -> Info { trace!("illumos::current_platform is called"); - let version = get_version() + let version = uname("-v") .map(Version::from_string) .unwrap_or_else(|| Version::Unknown); @@ -23,19 +23,10 @@ pub fn current_platform() -> Info { info } -fn get_version() -> Option { - uname("-v") -} - fn get_os() -> Type { - let os = match uname("-o") { - Some(o) => o, - None => return Type::Unknown, - }; - - match os.as_str() { + match uname("-o").as_deref() { "illumos" => Type::Illumos, - _ => Type::Unknown + _ => Type::Unknown, } } diff --git a/os_info/src/openbsd/mod.rs b/os_info/src/openbsd/mod.rs index c9eeee4d..77f90096 100644 --- a/os_info/src/openbsd/mod.rs +++ b/os_info/src/openbsd/mod.rs @@ -7,7 +7,7 @@ use crate::{architecture, bitness, uname::uname, Info, Type, Version}; pub fn current_platform() -> Info { trace!("openbsd::current_platform is called"); - let version = uname() + let version = uname("-r") .map(Version::from_string) .unwrap_or_else(|| Version::Unknown);