Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support of endeavourOS #210

Merged
merged 1 commit into from
Aug 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions os_info/src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ mod tests {
Type::Centos,
Type::Fedora,
Type::Solus,
Type::EndeavourOS,
Type::Manjaro,
Type::Alpine,
Type::Macos,
Expand Down
17 changes: 17 additions & 0 deletions os_info/src/linux/lsb_release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub fn get() -> Option<Info> {
Some("RedHatEnterprise") | Some("RedHatEnterpriseServer") => Type::RedHatEnterprise,
Some("Fedora") => Type::Fedora,
Some("Solus") => Type::Solus,
Some("EndeavourOS") => Type::EndeavourOS,
Some("Amazon") | Some("AmazonAMI") => Type::Amazon,
Some("SUSE") => Type::SUSE,
Some("openSUSE") => Type::openSUSE,
Expand Down Expand Up @@ -206,6 +207,13 @@ mod tests {
assert_eq!(parse_results.version, Some("19.0.2".to_string()));
}

#[test]
fn endeavouros() {
let parse_results = parse(endeavouros_file());
assert_eq!(parse_results.distribution, Some("EndeavourOS".to_string()));
assert_eq!(parse_results.version, Some("rolling".to_string()));
}

fn file() -> &'static str {
"\nDistributor ID: Debian\n\
Description: Debian GNU/Linux 7.8 (wheezy)\n\
Expand Down Expand Up @@ -356,4 +364,13 @@ mod tests {
Codename: n/a\n\
"
}

fn endeavouros_file() -> &'static str {
"LSB Version: 1.4\n\
Distributor ID: EndeavourOS\n\
Description: EndeavourOS Linux\n\
Release: rolling\n\
Codename: n/a\n\
"
}
}
1 change: 1 addition & 0 deletions os_info/src/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ mod tests {
| Type::openSUSE
| Type::OracleLinux
| Type::Solus
| Type::EndeavourOS
| Type::Manjaro
| Type::Alpine => (),
os_type => {
Expand Down
2 changes: 2 additions & 0 deletions os_info/src/os_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ pub enum Type {
Redox,
/// Solus (<https://en.wikipedia.org/wiki/Solus_(operating_system)>).
Solus,
/// EndeavourOS (<https://en.wikipedia.org/wiki/EndeavourOS>).
EndeavourOS,
/// SUSE Linux Enterprise Server (<https://en.wikipedia.org/wiki/SUSE_Linux_Enterprise>).
SUSE,
/// Ubuntu (<https://en.wikipedia.org/wiki/Ubuntu_(operating_system)>).
Expand Down