feat(linux.rs): Add support for Funtoo (#868)
* feat(linus.rs): Add support for Funtoo * style(linux.rs): fix clippy reccomendations * test(funtoo support): add funtoo test
This commit is contained in:
@@ -76,7 +76,7 @@ impl Distribution {
|
|||||||
Some("debian") | Some("pureos") | Some("Deepin") | Some("linuxmint") => Distribution::Debian,
|
Some("debian") | Some("pureos") | Some("Deepin") | Some("linuxmint") => Distribution::Debian,
|
||||||
Some("arch") | Some("manjaro-arm") | Some("garuda") | Some("artix") => Distribution::Arch,
|
Some("arch") | Some("manjaro-arm") | Some("garuda") | Some("artix") => Distribution::Arch,
|
||||||
Some("solus") => Distribution::Solus,
|
Some("solus") => Distribution::Solus,
|
||||||
Some("gentoo") => Distribution::Gentoo,
|
Some("gentoo") | Some("funtoo") => Distribution::Gentoo,
|
||||||
Some("exherbo") => Distribution::Exherbo,
|
Some("exherbo") => Distribution::Exherbo,
|
||||||
Some("nixos") => Distribution::NixOS,
|
Some("nixos") => Distribution::NixOS,
|
||||||
Some("opensuse-microos") => Distribution::SuseMicro,
|
Some("opensuse-microos") => Distribution::SuseMicro,
|
||||||
@@ -452,16 +452,21 @@ fn upgrade_gentoo(ctx: &ExecutionContext) -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
println!("Syncing portage");
|
println!("Syncing portage");
|
||||||
run_type
|
if let Some(ego) = which("ego") {
|
||||||
.execute(sudo)
|
// The Funtoo team doesn't reccomend running both ego sync and emerge --sync
|
||||||
.args(["emerge", "--sync"])
|
run_type.execute(sudo).arg(ego).arg("sync").status_checked()?;
|
||||||
.args(
|
} else {
|
||||||
ctx.config()
|
run_type
|
||||||
.emerge_sync_flags()
|
.execute(sudo)
|
||||||
.map(|s| s.split_whitespace().collect())
|
.args(["emerge", "--sync"])
|
||||||
.unwrap_or_else(|| vec!["-q"]),
|
.args(
|
||||||
)
|
ctx.config()
|
||||||
.status_checked()?;
|
.emerge_sync_flags()
|
||||||
|
.map(|s| s.split_whitespace().collect())
|
||||||
|
.unwrap_or_else(|| vec!["-q"]),
|
||||||
|
)
|
||||||
|
.status_checked()?;
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(eix_update) = which("eix-update") {
|
if let Some(eix_update) = which("eix-update") {
|
||||||
run_type.execute(sudo).arg(eix_update).status_checked()?;
|
run_type.execute(sudo).arg(eix_update).status_checked()?;
|
||||||
@@ -1185,6 +1190,11 @@ mod tests {
|
|||||||
test_template(include_str!("os_release/gentoo"), Distribution::Gentoo);
|
test_template(include_str!("os_release/gentoo"), Distribution::Gentoo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_funtoo() {
|
||||||
|
test_template(include_str!("os_release/funtoo"), Distribution::Gentoo);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_exherbo() {
|
fn test_exherbo() {
|
||||||
test_template(include_str!("os_release/exherbo"), Distribution::Exherbo);
|
test_template(include_str!("os_release/exherbo"), Distribution::Exherbo);
|
||||||
|
|||||||
6
src/steps/os/os_release/funtoo
Normal file
6
src/steps/os/os_release/funtoo
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
ID="funtoo"
|
||||||
|
NAME="Funtoo"
|
||||||
|
PRETTY_NAME="Funtoo Linux"
|
||||||
|
ANSI_COLOR="0;34"
|
||||||
|
HOME_URL="https://www.funtoo.org"
|
||||||
|
BUG_REPORT_URL="https://bugs.funtoo.org"
|
||||||
Reference in New Issue
Block a user