Skip to content

Commit

Permalink
Add support for Nobara Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartcampbell committed Mar 26, 2024
1 parent 8baea64 commit f313946
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions os_info/src/linux/lsb_release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub fn get() -> Option<Info> {
Some("ManjaroLinux") => Type::Manjaro,
Some("Mariner") => Type::Mariner,
Some("NixOS") => Type::NixOS,
Some("NobaraLinux") => Type::Nobara,
Some("OpenCloudOS") => Type::OpenCloudOS,
Some("openEuler") => Type::openEuler,
Some("openSUSE") => Type::openSUSE,
Expand Down Expand Up @@ -183,6 +184,17 @@ mod tests {
assert_eq!(parse_results.codename, Some("okapi".to_string()));
}

#[test]
fn nobara() {
let parse_results = parse(nobara_file());
assert_eq!(
parse_results.distribution,
Some("NobaraLinux".to_string())
);
assert_eq!(parse_results.version, Some("39".to_string()));
assert_eq!(parse_results.codename, None);
}

#[test]
fn amazon1() {
let parse_results = parse(amazon1_file());
Expand Down Expand Up @@ -407,6 +419,15 @@ mod tests {
Codename: okapi"
}

fn nobara_file() -> &'static str {
"LSB Version: n/a\n\
Distributor ID: NobaraLinux\n\
Description: Nobara Linux 39 (KDE Plasma)\n\
Release: 39\n\
Codename: n/a\n\
"
}

// Amazon Linux 1 uses a separate Distributor ID and Release format from Amazon Linux 2
fn amazon1_file() -> &'static str {
"LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch\n\
Expand Down

0 comments on commit f313946

Please sign in to comment.