Skip to content

Commit

Permalink
Merge pull request #359 from 8bitZeta/master
Browse files Browse the repository at this point in the history
Add Support for Ultramarine Linux
  • Loading branch information
stanislav-tkach authored Feb 21, 2024
2 parents 2f7258a + 5689bbd commit aa4fe9e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
12 changes: 12 additions & 0 deletions os_info/src/linux/file_release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ static DISTRIBUTIONS: [ReleaseInfo; 6] = [
"sles" => Some(Type::SUSE),
"sles_sap" => Some(Type::SUSE), // SUSE SAP
"ubuntu" => Some(Type::Ubuntu),
"ultramarine" => Some(Type::Ultramarine),

Check failure on line 138 in os_info/src/linux/file_release.rs

View workflow job for this annotation

GitHub Actions / clippy

no variant or associated item named `Ultramarine` found for enum `os_type::Type` in the current scope

error[E0599]: no variant or associated item named `Ultramarine` found for enum `os_type::Type` in the current scope --> os_info/src/linux/file_release.rs:138:49 | 138 | "ultramarine" => Some(Type::Ultramarine), | ^^^^^^^^^^^ variant or associated item not found in `Type` | ::: os_info/src/os_type.rs:8:1 | 8 | pub enum Type { | ------------- variant or associated item `Ultramarine` not found for this enum

Check failure on line 138 in os_info/src/linux/file_release.rs

View workflow job for this annotation

GitHub Actions / clippy

no variant or associated item named `Ultramarine` found for enum `os_type::Type` in the current scope

error[E0599]: no variant or associated item named `Ultramarine` found for enum `os_type::Type` in the current scope --> os_info/src/linux/file_release.rs:138:49 | 138 | "ultramarine" => Some(Type::Ultramarine), | ^^^^^^^^^^^ variant or associated item not found in `Type` | ::: os_info/src/os_type.rs:8:1 | 8 | pub enum Type { | ------------- variant or associated item `Ultramarine` not found for this enum

Check failure on line 138 in os_info/src/linux/file_release.rs

View workflow job for this annotation

GitHub Actions / Linux

no variant or associated item named `Ultramarine` found for enum `Type` in the current scope

Check failure on line 138 in os_info/src/linux/file_release.rs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

no variant or associated item named `Ultramarine` found for enum `Type` in the current scope
//"virtuozzo" => Virtuozzo
//"void" => Void
//"XCP-ng" => xcp-ng
Expand Down Expand Up @@ -590,6 +591,17 @@ mod tests {
assert_eq!(info.codename, None);
}

#[test]
fn ultramarine_os_release() {
let root = "src/linux/tests/Ultramarine";

let info = retrieve(&DISTRIBUTIONS, root).unwrap();
assert_eq!(info.os_type(), Type::Ultramarine);

Check failure on line 599 in os_info/src/linux/file_release.rs

View workflow job for this annotation

GitHub Actions / clippy

no variant or associated item named `Ultramarine` found for enum `os_type::Type` in the current scope

error[E0599]: no variant or associated item named `Ultramarine` found for enum `os_type::Type` in the current scope --> os_info/src/linux/file_release.rs:599:42 | 599 | assert_eq!(info.os_type(), Type::Ultramarine); | ^^^^^^^^^^^ variant or associated item not found in `Type` | ::: os_info/src/os_type.rs:8:1 | 8 | pub enum Type { | ------------- variant or associated item `Ultramarine` not found for this enum
assert_eq!(info.version, Version::Semantic(39, 0, 0));
assert_eq!(info.edition, None);
assert_eq!(info.codename, None);
}

#[test]
fn release_info_debug() {
dbg!("{:?}", &DISTRIBUTIONS[0]);
Expand Down
11 changes: 11 additions & 0 deletions os_info/src/linux/lsb_release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub fn get() -> Option<Info> {
Some("Solus") => Type::Solus,
Some("SUSE") => Type::SUSE,
Some("Ubuntu") => Type::Ubuntu,
Some("Ultramarine") => Type::Ultramarine,

Check failure on line 45 in os_info/src/linux/lsb_release.rs

View workflow job for this annotation

GitHub Actions / clippy

no variant or associated item named `Ultramarine` found for enum `os_type::Type` in the current scope

error[E0599]: no variant or associated item named `Ultramarine` found for enum `os_type::Type` in the current scope --> os_info/src/linux/lsb_release.rs:45:38 | 45 | Some("Ultramarine") => Type::Ultramarine, | ^^^^^^^^^^^ variant or associated item not found in `Type` | ::: os_info/src/os_type.rs:8:1 | 8 | pub enum Type { | ------------- variant or associated item `Ultramarine` not found for this enum

Check failure on line 45 in os_info/src/linux/lsb_release.rs

View workflow job for this annotation

GitHub Actions / clippy

no variant or associated item named `Ultramarine` found for enum `os_type::Type` in the current scope

error[E0599]: no variant or associated item named `Ultramarine` found for enum `os_type::Type` in the current scope --> os_info/src/linux/lsb_release.rs:45:38 | 45 | Some("Ultramarine") => Type::Ultramarine, | ^^^^^^^^^^^ variant or associated item not found in `Type` | ::: os_info/src/os_type.rs:8:1 | 8 | pub enum Type { | ------------- variant or associated item `Ultramarine` not found for this enum

Check failure on line 45 in os_info/src/linux/lsb_release.rs

View workflow job for this annotation

GitHub Actions / Linux

no variant or associated item named `Ultramarine` found for enum `Type` in the current scope

Check failure on line 45 in os_info/src/linux/lsb_release.rs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

no variant or associated item named `Ultramarine` found for enum `Type` in the current scope
_ => Type::Linux,
};

Expand Down Expand Up @@ -532,4 +533,14 @@ mod tests {
Codename: n/a\n\
"
}

fn ultramarine_file() -> &'static str {

"LSB Version: n/a\n\
Distributor ID: UltramarineLinux\n\
Description: Ultramarine Linux 39 (Kuma)\n\

Check warning on line 541 in os_info/src/linux/lsb_release.rs

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Kuma)
Release: 39\n\
Codename: kuma\n\

Check warning on line 543 in os_info/src/linux/lsb_release.rs

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (kuma)
"
}
}
21 changes: 21 additions & 0 deletions os_info/src/linux/tests/Ultramarine/os-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
NAME="Ultramarine Linux"
ID=ultramarine
VERSION="39 (Kuma)"
VERSION_CODENAME=kuma
ID_LIKE=fedora
PLATFORM_ID="platform:um39"
VERSION_ID=39
PRETTY_NAME="Ultramarine Linux 39 (Kuma)"
ANSI_COLOR="0;34"
LOGO=ultramarine
CPE_NAME="cpe:/o:ultramarine:um:39"
DEFAULT_HOSTNAME="ultramarine"
HOME_URL="http://ultramarine-linux.org"
SUPPORT_URL="https://discord.com/invite/bUuQasHdrF"
BUG_REPORT_URL="https://github.com/Ultramarine-Linux/ultramarine"
DOCUMENTATION_URL="https://wiki.ultramarine-linux.org"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=39
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=39
PRIVACY_POLICY_URL="https://fyralabs.com/privacy"

0 comments on commit aa4fe9e

Please sign in to comment.