diff --git a/src/steps/os/linux.rs b/src/steps/os/linux.rs index 60099503..9155dd30 100644 --- a/src/steps/os/linux.rs +++ b/src/steps/os/linux.rs @@ -57,6 +57,7 @@ impl Distribution { (Some("fedora"), _) => Distribution::Fedora, (Some("void"), _) => Distribution::Void, (Some("solus"), _) => Distribution::Solus, + (Some("gentoo"), _) => Distribution::Gentoo, _ => Err(ErrorKind::UnknownLinuxDistribution)?, }) } @@ -68,10 +69,6 @@ impl Distribution { return Self::parse_os_release(&os_release); } - if PathBuf::from("/etc/gentoo-release").exists() { - return Ok(Distribution::Gentoo); - } - Err(ErrorKind::UnknownLinuxDistribution)? } @@ -415,4 +412,9 @@ mod tests { fn test_anarchy() { test_template(&include_str!("os_release/anarchy"), Distribution::Arch); } + + #[test] + fn test_gentoo() { + test_template(&include_str!("os_release/gentoo"), Distribution::Gentoo); + } } diff --git a/src/steps/os/os_release/gentoo b/src/steps/os/os_release/gentoo new file mode 100644 index 00000000..2a75fec6 --- /dev/null +++ b/src/steps/os/os_release/gentoo @@ -0,0 +1,7 @@ +NAME=Gentoo +ID=gentoo +PRETTY_NAME="Gentoo/Linux" +ANSI_COLOR="1;32" +HOME_URL="https://www.gentoo.org/" +SUPPORT_URL="https://www.gentoo.org/support/" +BUG_REPORT_URL="https://bugs.gentoo.org/"