diff --git a/cspell-dictionary.txt b/cspell-dictionary.txt index 22cd404..4cc5de9 100644 --- a/cspell-dictionary.txt +++ b/cspell-dictionary.txt @@ -52,3 +52,5 @@ xbian xenenterprise xenial xenserver +ultramarine +kuma \ No newline at end of file diff --git a/deny.toml b/deny.toml index 9787a0a..7561744 100644 --- a/deny.toml +++ b/deny.toml @@ -33,8 +33,8 @@ targets = [ [advisories] # The path where the advisory database is cloned/fetched into db-path = "~/.cargo/advisory-db" -# The url of the advisory database to use -db-url = "https://github.com/rustsec/advisory-db" +# The url(s) of the advisory databases to use +db-urls = ["https://github.com/rustsec/advisory-db"] # The lint level for security vulnerabilities vulnerability = "deny" # The lint level for unmaintained crates diff --git a/os_info/src/info.rs b/os_info/src/info.rs index 50b5706..5242836 100644 --- a/os_info/src/info.rs +++ b/os_info/src/info.rs @@ -238,6 +238,7 @@ mod tests { Type::Solus, Type::SUSE, Type::Ubuntu, + Type::Ultramarine, Type::Mint, Type::Unknown, Type::Windows, diff --git a/os_info/src/linux/lsb_release.rs b/os_info/src/linux/lsb_release.rs index 53c76bc..113d60f 100644 --- a/os_info/src/linux/lsb_release.rs +++ b/os_info/src/linux/lsb_release.rs @@ -42,7 +42,7 @@ pub fn get() -> Option { Some("Solus") => Type::Solus, Some("SUSE") => Type::SUSE, Some("Ubuntu") => Type::Ubuntu, - Some("Ultramarine") => Type::Ultramarine, + Some("UltramarineLinux") => Type::Ultramarine, _ => Type::Linux, }; @@ -311,6 +311,17 @@ mod tests { assert_eq!(parse_results.codename, None); } + #[test] + fn ultramarine() { + let parse_results = parse(ultramarine_file()); + assert_eq!( + parse_results.distribution, + Some("UltramarineLinux".to_string()) + ); + assert_eq!(parse_results.version, Some("39".to_string())); + assert_eq!(parse_results.codename, Some("kuma".to_string())); + } + #[test] fn raspbian() { let parse_results = parse(raspberry_os_file()); @@ -535,7 +546,6 @@ mod tests { } fn ultramarine_file() -> &'static str { - "LSB Version: n/a\n\ Distributor ID: UltramarineLinux\n\ Description: Ultramarine Linux 39 (Kuma)\n\ diff --git a/os_info/src/linux/mod.rs b/os_info/src/linux/mod.rs index c1b472c..2fab351 100644 --- a/os_info/src/linux/mod.rs +++ b/os_info/src/linux/mod.rs @@ -56,6 +56,7 @@ mod tests { | Type::Solus | Type::SUSE | Type::Ubuntu + | Type::Ultramarine | Type::Mint => (), os_type => { panic!("Unexpected OS type: {}", os_type); diff --git a/os_info/src/linux/tests/Ultramarine/os-release b/os_info/src/linux/tests/Ultramarine/etc/os-release similarity index 100% rename from os_info/src/linux/tests/Ultramarine/os-release rename to os_info/src/linux/tests/Ultramarine/etc/os-release diff --git a/os_info/src/os_type.rs b/os_info/src/os_type.rs index 4516d24..b7330ad 100644 --- a/os_info/src/os_type.rs +++ b/os_info/src/os_type.rs @@ -92,6 +92,8 @@ pub enum Type { SUSE, /// Ubuntu (). Ubuntu, + /// Ultramarine (). + Ultramarine, /// Unknown operating system. Unknown, /// Windows (). @@ -127,6 +129,7 @@ impl Display for Type { Type::RedHatEnterprise => write!(f, "Red Hat Enterprise Linux"), Type::RockyLinux => write!(f, "Rocky Linux"), Type::SUSE => write!(f, "SUSE Linux Enterprise Server"), + Type::Ultramarine => write!(f, "Ultramarine Linux"), _ => write!(f, "{self:?}"), } } @@ -178,6 +181,7 @@ mod tests { (Type::Solus, "Solus"), (Type::SUSE, "SUSE Linux Enterprise Server"), (Type::Ubuntu, "Ubuntu"), + (Type::Ultramarine, "Ultramarine Linux"), (Type::Unknown, "Unknown"), (Type::Windows, "Windows"), ];