diff --git a/CHANGELOG.md b/CHANGELOG.md index c39732af..29762e0a 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.7.0] (2023-03-20) + +- Information about a processor's architecture has been added. (#336) + +- Mabox Linux support has been added. (#338) + +- Alpaquita Linux support has been added. (#340) + +- Artix Linux support has been added. (#342) + ## [3.6.0] (2023-01-30) - OpenCloudOS support has been added. (#328) @@ -281,7 +291,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.6.0...HEAD +[Unreleased]: https://github.com/stanislav-tkach/os_info/compare/v3.7.0...HEAD +[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 diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 9019c37f..d827bc2d 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.6.0", default-features = false, path = "../os_info" } +os_info = { version = "3.7.0", default-features = false, path = "../os_info" } log = "0.4.5" env_logger = "0.10" clap = { version = "4", features = ["derive"] } diff --git a/cspell-dictionary.txt b/cspell-dictionary.txt index 1eb87c01..22cd404a 100644 --- a/cspell-dictionary.txt +++ b/cspell-dictionary.txt @@ -1,5 +1,6 @@ aarch64 almalinux +alpaquita antergos aosc archarm @@ -22,11 +23,13 @@ illumos isainfo libntdll linuxmint +mabox macos mageia manjaro midnightbsd msvc +musl netbsd nixos openbsd diff --git a/os_info/Cargo.toml b/os_info/Cargo.toml index 9907ca0a..3fbfeada 100644 --- a/os_info/Cargo.toml +++ b/os_info/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "os_info" -version = "3.6.0" +version = "3.7.0" 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/architecture.rs b/os_info/src/architecture.rs index f35068ea..d6de08b2 100644 --- a/os_info/src/architecture.rs +++ b/os_info/src/architecture.rs @@ -2,7 +2,7 @@ use std::process::Command; use log::error; -pub fn architecture() -> Option { +pub fn get() -> Option { Command::new("uname") .arg("-m") .output() @@ -26,7 +26,7 @@ mod tests { #[test] fn uname_nonempty() { - let val = architecture().expect("uname failed"); + let val = get().expect("uname failed"); assert!(!val.is_empty()); } } diff --git a/os_info/src/info.rs b/os_info/src/info.rs index 22ef4da2..91e6cc3c 100644 --- a/os_info/src/info.rs +++ b/os_info/src/info.rs @@ -31,7 +31,7 @@ pub struct Info { /// Operating system architecture in terms of how many bits compose the basic values it can deal /// with. See `Bitness` for details. pub(crate) bitness: Bitness, - // Processor architecture. + /// Processor architecture. pub(crate) architecture: Option, } diff --git a/os_info/src/lib.rs b/os_info/src/lib.rs index c983a739..83c7f387 100644 --- a/os_info/src/lib.rs +++ b/os_info/src/lib.rs @@ -7,7 +7,7 @@ missing_debug_implementations, missing_docs, unsafe_code, - rustdoc::missing_doc_code_examples + missing_doc_code_examples )] #[cfg(target_os = "android")] @@ -70,6 +70,12 @@ mod imp; #[path = "unknown/mod.rs"] mod imp; +#[cfg(any( + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd" +))] mod architecture; mod bitness; mod info; diff --git a/os_info/src/linux/mod.rs b/os_info/src/linux/mod.rs index a361c412..ac5c8cc0 100644 --- a/os_info/src/linux/mod.rs +++ b/os_info/src/linux/mod.rs @@ -12,7 +12,7 @@ pub fn current_platform() -> Info { .or_else(file_release::get) .unwrap_or_else(|| Info::with_type(Type::Linux)); info.bitness = bitness::get(); - info.architecture = architecture::architecture(); + info.architecture = architecture::get(); trace!("Returning {:?}", info); info diff --git a/os_info/src/macos/mod.rs b/os_info/src/macos/mod.rs index e03efc1f..aef79d27 100644 --- a/os_info/src/macos/mod.rs +++ b/os_info/src/macos/mod.rs @@ -2,7 +2,7 @@ use std::process::Command; use log::{trace, warn}; -use crate::{architecture::architecture, bitness, matcher::Matcher, Info, Type, Version}; +use crate::{architecture, bitness, matcher::Matcher, Info, Type, Version}; pub fn current_platform() -> Info { trace!("macos::current_platform is called"); @@ -11,7 +11,7 @@ pub fn current_platform() -> Info { os_type: Type::Macos, version: version(), bitness: bitness::get(), - architecture: architecture(), + architecture: architecture::get(), ..Default::default() }; trace!("Returning {:?}", info); diff --git a/os_info/src/netbsd/mod.rs b/os_info/src/netbsd/mod.rs index 708c0fae..7031820b 100644 --- a/os_info/src/netbsd/mod.rs +++ b/os_info/src/netbsd/mod.rs @@ -2,7 +2,7 @@ use std::process::Command; use log::{error, trace}; -use crate::{architecture::architecture, bitness, uname::uname, Info, Type, Version}; +use crate::{architecture, bitness, uname::uname, Info, Type, Version}; pub fn current_platform() -> Info { trace!("netbsd::current_platform is called"); @@ -15,7 +15,7 @@ pub fn current_platform() -> Info { os_type: Type::NetBSD, version, bitness: bitness::get(), - architecture: architecture::architecture(), + architecture: architecture::get(), ..Default::default() }; diff --git a/os_info/src/openbsd/mod.rs b/os_info/src/openbsd/mod.rs index 8e923168..c9eeee4d 100644 --- a/os_info/src/openbsd/mod.rs +++ b/os_info/src/openbsd/mod.rs @@ -2,7 +2,7 @@ use std::process::Command; use log::{error, trace}; -use crate::{architecture::architecture, bitness, uname::uname, Info, Type, Version}; +use crate::{architecture, bitness, uname::uname, Info, Type, Version}; pub fn current_platform() -> Info { trace!("openbsd::current_platform is called"); @@ -15,7 +15,7 @@ pub fn current_platform() -> Info { os_type: Type::OpenBSD, version, bitness: bitness::get(), - architecture: architecture::architecture(), + architecture: architecture::get(), ..Default::default() };