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("arch") | Some("manjaro-arm") | Some("garuda") | Some("artix") => Distribution::Arch,
|
||||
Some("solus") => Distribution::Solus,
|
||||
Some("gentoo") => Distribution::Gentoo,
|
||||
Some("gentoo") | Some("funtoo") => Distribution::Gentoo,
|
||||
Some("exherbo") => Distribution::Exherbo,
|
||||
Some("nixos") => Distribution::NixOS,
|
||||
Some("opensuse-microos") => Distribution::SuseMicro,
|
||||
@@ -452,16 +452,21 @@ fn upgrade_gentoo(ctx: &ExecutionContext) -> Result<()> {
|
||||
}
|
||||
|
||||
println!("Syncing portage");
|
||||
run_type
|
||||
.execute(sudo)
|
||||
.args(["emerge", "--sync"])
|
||||
.args(
|
||||
ctx.config()
|
||||
.emerge_sync_flags()
|
||||
.map(|s| s.split_whitespace().collect())
|
||||
.unwrap_or_else(|| vec!["-q"]),
|
||||
)
|
||||
.status_checked()?;
|
||||
if let Some(ego) = which("ego") {
|
||||
// The Funtoo team doesn't reccomend running both ego sync and emerge --sync
|
||||
run_type.execute(sudo).arg(ego).arg("sync").status_checked()?;
|
||||
} else {
|
||||
run_type
|
||||
.execute(sudo)
|
||||
.args(["emerge", "--sync"])
|
||||
.args(
|
||||
ctx.config()
|
||||
.emerge_sync_flags()
|
||||
.map(|s| s.split_whitespace().collect())
|
||||
.unwrap_or_else(|| vec!["-q"]),
|
||||
)
|
||||
.status_checked()?;
|
||||
}
|
||||
|
||||
if let Some(eix_update) = which("eix-update") {
|
||||
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]
|
||||
fn test_funtoo() {
|
||||
test_template(include_str!("os_release/funtoo"), Distribution::Gentoo);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_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