From 10f35fc2822202f19074b644f77113c1d5047cb1 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Tue, 3 Jan 2023 21:08:20 -0600 Subject: [PATCH] refactor/uname ~ use platform_info-v1.0.2 --- src/uu/uname/Cargo.toml | 2 +- src/uu/uname/src/uname.rs | 23 +---------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/uu/uname/Cargo.toml b/src/uu/uname/Cargo.toml index cc7b5f43b..b3d8d5c13 100644 --- a/src/uu/uname/Cargo.toml +++ b/src/uu/uname/Cargo.toml @@ -15,7 +15,7 @@ edition = "2021" path = "src/uname.rs" [dependencies] -platform-info = "1.0.1" +platform-info = "1.0.2" clap = { version = "4.0", features = ["wrap_help", "cargo"] } uucore = { version=">=0.0.16", package="uucore", path="../../uucore" } diff --git a/src/uu/uname/src/uname.rs b/src/uu/uname/src/uname.rs index e89cb3efe..a88ca1fd4 100644 --- a/src/uu/uname/src/uname.rs +++ b/src/uu/uname/src/uname.rs @@ -33,27 +33,6 @@ pub mod options { pub static OS: &str = "operating-system"; } -#[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "")))] -const HOST_OS: &str = "GNU/Linux"; -#[cfg(all(target_os = "linux", not(any(target_env = "gnu", target_env = ""))))] -const HOST_OS: &str = "Linux"; -#[cfg(target_os = "android")] -const HOST_OS: &str = "Android"; -#[cfg(target_os = "windows")] -const HOST_OS: &str = "Windows NT"; -#[cfg(target_os = "freebsd")] -const HOST_OS: &str = "FreeBSD"; -#[cfg(target_os = "netbsd")] -const HOST_OS: &str = "NetBSD"; -#[cfg(target_os = "openbsd")] -const HOST_OS: &str = "OpenBSD"; -#[cfg(target_vendor = "apple")] -const HOST_OS: &str = "Darwin"; -#[cfg(target_os = "fuchsia")] -const HOST_OS: &str = "Fuchsia"; -#[cfg(target_os = "redox")] -const HOST_OS: &str = "Redox"; - #[uucore::main] pub fn uumain(args: impl uucore::Args) -> UResult<()> { let matches = uu_app().try_get_matches_from(args)?; @@ -108,7 +87,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { } if os || all { - output.push_str(HOST_OS); + output.push_str(&uname.osname()); output.push(' '); }