Fix Linux Mint
This commit is contained in:
@@ -36,26 +36,18 @@ impl Distribution {
|
||||
serde_ini::de::from_read(fs::File::open(OS_RELEASE_PATH).context(ErrorKind::UnknownLinuxDistribution)?)
|
||||
.context(ErrorKind::UnknownLinuxDistribution)?;
|
||||
|
||||
match os_release.id_like.as_ref().map(String::as_str) {
|
||||
Some("debian") => {
|
||||
return Ok(Distribution::Debian);
|
||||
}
|
||||
Some("\"suse\"") => {
|
||||
return Ok(Distribution::Suse);
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
||||
if let Some("debian") = os_release.id_like.as_ref().map(String::as_str) {}
|
||||
|
||||
Ok(match os_release.id.as_ref() {
|
||||
"arch" => Distribution::Arch,
|
||||
"centos" | "\"ol\"" => Distribution::CentOS,
|
||||
"fedora" => Distribution::Fedora,
|
||||
"void" => Distribution::Void,
|
||||
"solus" => Distribution::Solus,
|
||||
_ => Err(ErrorKind::UnknownLinuxDistribution)?,
|
||||
})
|
||||
Ok(
|
||||
match (os_release.id.as_ref(), os_release.id_like.as_ref().map(String::as_str)) {
|
||||
(_, Some("debian")) | (_, Some("ubuntu")) => Distribution::Debian,
|
||||
(_, Some("\"suse\"")) => Distribution::Suse,
|
||||
("arch", _) => Distribution::Arch,
|
||||
("centos", _) | ("\"ol\"", _) => Distribution::CentOS,
|
||||
("fedora", _) => Distribution::Fedora,
|
||||
("void", _) => Distribution::Void,
|
||||
("solus", _) => Distribution::Solus,
|
||||
_ => Err(ErrorKind::UnknownLinuxDistribution)?,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
pub fn detect() -> Result<Self, Error> {
|
||||
|
||||
Reference in New Issue
Block a user