Files
topgrade/src/steps/os/linux.rs

1295 lines
36 KiB
Rust
Raw Normal View History

2022-01-06 21:41:36 +02:00
use std::path::{Path, PathBuf};
use std::process::Command;
2022-11-11 09:39:29 -05:00
use color_eyre::eyre::Result;
2022-01-06 21:41:36 +02:00
use ini::Ini;
use rust_i18n::t;
2022-11-16 13:43:57 -05:00
use tracing::{debug, warn};
2022-01-06 21:41:36 +02:00
use crate::command::CommandExt;
use crate::error::{SkipStep, TopgradeError};
2020-05-14 09:22:14 +03:00
use crate::execution_context::ExecutionContext;
use crate::step::Step;
use crate::steps::generic::is_wsl;
use crate::steps::os::archlinux;
use crate::sudo::SudoExecuteOpts;
2024-02-16 11:57:53 +08:00
use crate::terminal::{print_separator, prompt_yesno};
use crate::utils::{require, require_one, which, PathExt};
use crate::HOME_DIR;
static OS_RELEASE_PATH: &str = "/etc/os-release";
2021-04-06 10:28:07 +03:00
#[allow(clippy::upper_case_acronyms)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum Distribution {
2021-07-06 09:24:42 +03:00
Alpine,
Wolfi,
Arch,
Add Bedrock Linux support (fix #745) (#747) * Bedrock Linux (fix #745) * Add more distributions * fix * fix * Fix * Merge * Move pacnew to the correct location * Version bump * Correct spelling for GNOME Shell extensions update (#778) * fix gnome shell extensions update object path (#788) * config: ArchPackageManager should be snake_case (#784) * config: ArchPackageManager should be snake_case * Remove unnecessary strum macro * Add arch_package_manager to config.example.toml * Add release pipeline * Run GNOME update only when using GNOME * Delete travis file and appveyor * Bump * Support rust 1.51.0 (#789) * Cross compilation * Bump * fix: GNOME detection for customized version (#790) Signed-off-by: Noel Georgi <git@frezbo.dev> * Add a flag to disable showing Arch Linux news (fix #786) * Bump * Update pacstall (fix #769) * Add an option to force vim plug update (#795) * Add an option to force vim plug update (fix #751) * Rustfmt * Update src/config.rs Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: M*C*O <mcofficer@gmx.de> * Add new step pacdiff (#796) * Add Support for Spicetify (#798) * Look for ~/.config/emacs directory in Windows (fix #766) * Pass --force to doom when -y is set (fix #799) * Implement cleanup for flatpak (#801) * Cleanup flatpak * Fix compile error * Make sure we only move our values at the very end * Access config.cleanup() through ExecutionContext * Improve man page (#803) Wordings & argument format * Avoid running remote topgrade on the current host (fix #804) (#807) * Merge the command line and the configuration flags of --only and --disable (fix #805) (#806) * Merge the command line and the configuration flags of --only and --disable (fix #805) * Fix * Fix rust requirement in the readme * Selective yes (fix #802) (#808) * Selective yes flag (fix #802) * Selective yes flag (fix #802) * selective yes * MacOS * Fix bedrock detection * Bedrock fixes * format * Fedora fixes Co-authored-by: Björn Daase <bjoern.daase@gmail.com> Co-authored-by: modularTaco <37046961+modularTaco@users.noreply.github.com> Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: Noel Georgi <git@frezbo.dev> Co-authored-by: Manuel Hässig <mhaessig@users.noreply.github.com> Co-authored-by: Janek <27jf@pm.me>
2021-12-09 15:16:42 +02:00
Bedrock,
CentOS,
Chimera,
ClearLinux,
Fedora,
FedoraImmutable,
Debian,
2018-10-21 15:08:36 +03:00
Gentoo,
NILRT,
2022-10-17 18:48:59 +02:00
OpenMandriva,
OpenSuseTumbleweed,
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
PCLinuxOS,
Suse,
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
SuseMicro,
2023-05-29 19:45:11 +08:00
Vanilla,
2018-11-20 14:38:23 +02:00
Void,
2019-03-21 10:36:40 -07:00
Solus,
Exherbo,
NixOS,
KDENeon,
Nobara,
}
impl Distribution {
fn parse_os_release(os_release: &Ini) -> Result<Self> {
2019-05-16 15:37:35 +03:00
let section = os_release.general_section();
2020-02-29 20:15:28 +02:00
let id = section.get("ID");
2023-05-29 19:45:11 +08:00
let name = section.get("NAME");
let variant = section.get("VARIANT");
2020-02-29 20:15:28 +02:00
let id_like: Option<Vec<&str>> = section.get("ID_LIKE").map(|s| s.split_whitespace().collect());
2019-09-05 21:04:07 +03:00
Ok(match id {
2021-07-06 09:24:42 +03:00
Some("alpine") => Distribution::Alpine,
Some("chimera") => Distribution::Chimera,
Some("wolfi") => Distribution::Wolfi,
2021-10-28 22:05:35 +03:00
Some("centos") | Some("rhel") | Some("ol") => Distribution::CentOS,
Some("clear-linux-os") => Distribution::ClearLinux,
Some("fedora") => Distribution::match_fedora_variant(&variant),
Some("nilrt") => Distribution::NILRT,
Some("nobara") => Distribution::Nobara,
2019-09-05 21:04:07 +03:00
Some("void") => Distribution::Void,
Some("debian") | Some("pureos") | Some("Deepin") | Some("linuxmint") => Distribution::Debian,
Some("arch") | Some("manjaro-arm") | Some("garuda") | Some("artix") | Some("cachyos") => Distribution::Arch,
2019-09-05 21:04:07 +03:00
Some("solus") => Distribution::Solus,
Some("gentoo") | Some("funtoo") => Distribution::Gentoo,
2019-09-05 21:04:07 +03:00
Some("exherbo") => Distribution::Exherbo,
Some("nixos") => Distribution::NixOS,
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
Some("opensuse-microos") => Distribution::SuseMicro,
Some("neon") => Distribution::KDENeon,
2022-10-17 18:48:59 +02:00
Some("openmandriva") => Distribution::OpenMandriva,
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
Some("pclinuxos") => Distribution::PCLinuxOS,
_ => {
2023-05-29 19:45:11 +08:00
if let Some(name) = name {
if name.contains("Vanilla") {
return Ok(Distribution::Vanilla);
}
}
if let Some(id_like) = id_like {
if id_like.contains(&"debian") || id_like.contains(&"ubuntu") {
return Ok(Distribution::Debian);
} else if id_like.contains(&"centos") {
return Ok(Distribution::CentOS);
} else if id_like.contains(&"suse") {
let id_variant = id.unwrap_or_default();
return if id_variant.contains("tumbleweed") {
Ok(Distribution::OpenSuseTumbleweed)
} else {
Ok(Distribution::Suse)
};
} else if id_like.contains(&"arch") || id_like.contains(&"archlinux") {
return Ok(Distribution::Arch);
} else if id_like.contains(&"alpine") {
return Ok(Distribution::Alpine);
} else if id_like.contains(&"fedora") {
return Ok(Distribution::match_fedora_variant(&variant));
}
}
return Err(TopgradeError::UnknownLinuxDistribution.into());
}
})
}
2019-03-21 10:36:40 -07:00
fn match_fedora_variant(variant: &Option<&str>) -> Self {
if let Some("Silverblue" | "Kinoite" | "Sericea" | "Onyx" | "IoT Edition" | "Sway Atomic" | "CoreOS") = variant
{
Distribution::FedoraImmutable
} else {
Distribution::Fedora
}
}
pub fn detect() -> Result<Self> {
Add Bedrock Linux support (fix #745) (#747) * Bedrock Linux (fix #745) * Add more distributions * fix * fix * Fix * Merge * Move pacnew to the correct location * Version bump * Correct spelling for GNOME Shell extensions update (#778) * fix gnome shell extensions update object path (#788) * config: ArchPackageManager should be snake_case (#784) * config: ArchPackageManager should be snake_case * Remove unnecessary strum macro * Add arch_package_manager to config.example.toml * Add release pipeline * Run GNOME update only when using GNOME * Delete travis file and appveyor * Bump * Support rust 1.51.0 (#789) * Cross compilation * Bump * fix: GNOME detection for customized version (#790) Signed-off-by: Noel Georgi <git@frezbo.dev> * Add a flag to disable showing Arch Linux news (fix #786) * Bump * Update pacstall (fix #769) * Add an option to force vim plug update (#795) * Add an option to force vim plug update (fix #751) * Rustfmt * Update src/config.rs Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: M*C*O <mcofficer@gmx.de> * Add new step pacdiff (#796) * Add Support for Spicetify (#798) * Look for ~/.config/emacs directory in Windows (fix #766) * Pass --force to doom when -y is set (fix #799) * Implement cleanup for flatpak (#801) * Cleanup flatpak * Fix compile error * Make sure we only move our values at the very end * Access config.cleanup() through ExecutionContext * Improve man page (#803) Wordings & argument format * Avoid running remote topgrade on the current host (fix #804) (#807) * Merge the command line and the configuration flags of --only and --disable (fix #805) (#806) * Merge the command line and the configuration flags of --only and --disable (fix #805) * Fix * Fix rust requirement in the readme * Selective yes (fix #802) (#808) * Selective yes flag (fix #802) * Selective yes flag (fix #802) * selective yes * MacOS * Fix bedrock detection * Bedrock fixes * format * Fedora fixes Co-authored-by: Björn Daase <bjoern.daase@gmail.com> Co-authored-by: modularTaco <37046961+modularTaco@users.noreply.github.com> Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: Noel Georgi <git@frezbo.dev> Co-authored-by: Manuel Hässig <mhaessig@users.noreply.github.com> Co-authored-by: Janek <27jf@pm.me>
2021-12-09 15:16:42 +02:00
if PathBuf::from("/bedrock").exists() {
return Ok(Distribution::Bedrock);
}
if PathBuf::from(OS_RELEASE_PATH).exists() {
let os_release = Ini::load_from_file(OS_RELEASE_PATH)?;
if os_release.general_section().is_empty() {
return Err(TopgradeError::EmptyOSReleaseFile.into());
}
return Self::parse_os_release(&os_release);
2019-04-14 11:25:40 +03:00
}
Err(TopgradeError::EmptyOSReleaseFile.into())
}
2020-05-14 09:22:14 +03:00
pub fn upgrade(self, ctx: &ExecutionContext) -> Result<()> {
print_separator(t!("System update"));
2019-02-11 14:10:06 +02:00
match self {
2021-07-06 09:24:42 +03:00
Distribution::Alpine => upgrade_alpine_linux(ctx),
Distribution::Chimera => upgrade_chimera_linux(ctx),
Distribution::Wolfi => upgrade_wolfi_linux(ctx),
Distribution::Arch => archlinux::upgrade_arch_linux(ctx),
2020-05-14 09:22:14 +03:00
Distribution::CentOS | Distribution::Fedora => upgrade_redhat(ctx),
Distribution::FedoraImmutable => upgrade_fedora_immutable(ctx),
2021-09-02 17:09:48 +00:00
Distribution::ClearLinux => upgrade_clearlinux(ctx),
2021-04-06 10:54:23 +03:00
Distribution::Debian => upgrade_debian(ctx),
Distribution::Gentoo => upgrade_gentoo(ctx),
2021-09-02 17:09:48 +00:00
Distribution::Suse => upgrade_suse(ctx),
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
Distribution::SuseMicro => upgrade_suse_micro(ctx),
Distribution::OpenSuseTumbleweed => upgrade_opensuse_tumbleweed(ctx),
2023-05-29 19:45:11 +08:00
Distribution::Vanilla => upgrade_vanilla(ctx),
2021-09-02 17:09:48 +00:00
Distribution::Void => upgrade_void(ctx),
Distribution::Solus => upgrade_solus(ctx),
Distribution::Exherbo => upgrade_exherbo(ctx),
Distribution::NixOS => upgrade_nixos(ctx),
Distribution::KDENeon => upgrade_neon(ctx),
Add Bedrock Linux support (fix #745) (#747) * Bedrock Linux (fix #745) * Add more distributions * fix * fix * Fix * Merge * Move pacnew to the correct location * Version bump * Correct spelling for GNOME Shell extensions update (#778) * fix gnome shell extensions update object path (#788) * config: ArchPackageManager should be snake_case (#784) * config: ArchPackageManager should be snake_case * Remove unnecessary strum macro * Add arch_package_manager to config.example.toml * Add release pipeline * Run GNOME update only when using GNOME * Delete travis file and appveyor * Bump * Support rust 1.51.0 (#789) * Cross compilation * Bump * fix: GNOME detection for customized version (#790) Signed-off-by: Noel Georgi <git@frezbo.dev> * Add a flag to disable showing Arch Linux news (fix #786) * Bump * Update pacstall (fix #769) * Add an option to force vim plug update (#795) * Add an option to force vim plug update (fix #751) * Rustfmt * Update src/config.rs Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: M*C*O <mcofficer@gmx.de> * Add new step pacdiff (#796) * Add Support for Spicetify (#798) * Look for ~/.config/emacs directory in Windows (fix #766) * Pass --force to doom when -y is set (fix #799) * Implement cleanup for flatpak (#801) * Cleanup flatpak * Fix compile error * Make sure we only move our values at the very end * Access config.cleanup() through ExecutionContext * Improve man page (#803) Wordings & argument format * Avoid running remote topgrade on the current host (fix #804) (#807) * Merge the command line and the configuration flags of --only and --disable (fix #805) (#806) * Merge the command line and the configuration flags of --only and --disable (fix #805) * Fix * Fix rust requirement in the readme * Selective yes (fix #802) (#808) * Selective yes flag (fix #802) * Selective yes flag (fix #802) * selective yes * MacOS * Fix bedrock detection * Bedrock fixes * format * Fedora fixes Co-authored-by: Björn Daase <bjoern.daase@gmail.com> Co-authored-by: modularTaco <37046961+modularTaco@users.noreply.github.com> Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: Noel Georgi <git@frezbo.dev> Co-authored-by: Manuel Hässig <mhaessig@users.noreply.github.com> Co-authored-by: Janek <27jf@pm.me>
2021-12-09 15:16:42 +02:00
Distribution::Bedrock => update_bedrock(ctx),
2022-10-17 18:48:59 +02:00
Distribution::OpenMandriva => upgrade_openmandriva(ctx),
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
Distribution::PCLinuxOS => upgrade_pclinuxos(ctx),
Distribution::Nobara => upgrade_nobara(ctx),
Distribution::NILRT => upgrade_nilrt(ctx),
2019-02-11 14:10:06 +02:00
}
}
pub fn show_summary(self) {
if let Distribution::Arch = self {
2021-10-25 22:53:53 +03:00
archlinux::show_pacnew();
}
}
pub fn redhat_based(self) -> bool {
2020-10-24 14:46:38 -05:00
matches!(self, Distribution::CentOS | Distribution::Fedora)
}
}
Add Bedrock Linux support (fix #745) (#747) * Bedrock Linux (fix #745) * Add more distributions * fix * fix * Fix * Merge * Move pacnew to the correct location * Version bump * Correct spelling for GNOME Shell extensions update (#778) * fix gnome shell extensions update object path (#788) * config: ArchPackageManager should be snake_case (#784) * config: ArchPackageManager should be snake_case * Remove unnecessary strum macro * Add arch_package_manager to config.example.toml * Add release pipeline * Run GNOME update only when using GNOME * Delete travis file and appveyor * Bump * Support rust 1.51.0 (#789) * Cross compilation * Bump * fix: GNOME detection for customized version (#790) Signed-off-by: Noel Georgi <git@frezbo.dev> * Add a flag to disable showing Arch Linux news (fix #786) * Bump * Update pacstall (fix #769) * Add an option to force vim plug update (#795) * Add an option to force vim plug update (fix #751) * Rustfmt * Update src/config.rs Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: M*C*O <mcofficer@gmx.de> * Add new step pacdiff (#796) * Add Support for Spicetify (#798) * Look for ~/.config/emacs directory in Windows (fix #766) * Pass --force to doom when -y is set (fix #799) * Implement cleanup for flatpak (#801) * Cleanup flatpak * Fix compile error * Make sure we only move our values at the very end * Access config.cleanup() through ExecutionContext * Improve man page (#803) Wordings & argument format * Avoid running remote topgrade on the current host (fix #804) (#807) * Merge the command line and the configuration flags of --only and --disable (fix #805) (#806) * Merge the command line and the configuration flags of --only and --disable (fix #805) * Fix * Fix rust requirement in the readme * Selective yes (fix #802) (#808) * Selective yes flag (fix #802) * Selective yes flag (fix #802) * selective yes * MacOS * Fix bedrock detection * Bedrock fixes * format * Fedora fixes Co-authored-by: Björn Daase <bjoern.daase@gmail.com> Co-authored-by: modularTaco <37046961+modularTaco@users.noreply.github.com> Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: Noel Georgi <git@frezbo.dev> Co-authored-by: Manuel Hässig <mhaessig@users.noreply.github.com> Co-authored-by: Janek <27jf@pm.me>
2021-12-09 15:16:42 +02:00
fn update_bedrock(ctx: &ExecutionContext) -> Result<()> {
let brl = require("brl")?;
Add Bedrock Linux support (fix #745) (#747) * Bedrock Linux (fix #745) * Add more distributions * fix * fix * Fix * Merge * Move pacnew to the correct location * Version bump * Correct spelling for GNOME Shell extensions update (#778) * fix gnome shell extensions update object path (#788) * config: ArchPackageManager should be snake_case (#784) * config: ArchPackageManager should be snake_case * Remove unnecessary strum macro * Add arch_package_manager to config.example.toml * Add release pipeline * Run GNOME update only when using GNOME * Delete travis file and appveyor * Bump * Support rust 1.51.0 (#789) * Cross compilation * Bump * fix: GNOME detection for customized version (#790) Signed-off-by: Noel Georgi <git@frezbo.dev> * Add a flag to disable showing Arch Linux news (fix #786) * Bump * Update pacstall (fix #769) * Add an option to force vim plug update (#795) * Add an option to force vim plug update (fix #751) * Rustfmt * Update src/config.rs Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: M*C*O <mcofficer@gmx.de> * Add new step pacdiff (#796) * Add Support for Spicetify (#798) * Look for ~/.config/emacs directory in Windows (fix #766) * Pass --force to doom when -y is set (fix #799) * Implement cleanup for flatpak (#801) * Cleanup flatpak * Fix compile error * Make sure we only move our values at the very end * Access config.cleanup() through ExecutionContext * Improve man page (#803) Wordings & argument format * Avoid running remote topgrade on the current host (fix #804) (#807) * Merge the command line and the configuration flags of --only and --disable (fix #805) (#806) * Merge the command line and the configuration flags of --only and --disable (fix #805) * Fix * Fix rust requirement in the readme * Selective yes (fix #802) (#808) * Selective yes flag (fix #802) * Selective yes flag (fix #802) * selective yes * MacOS * Fix bedrock detection * Bedrock fixes * format * Fedora fixes Co-authored-by: Björn Daase <bjoern.daase@gmail.com> Co-authored-by: modularTaco <37046961+modularTaco@users.noreply.github.com> Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: Noel Georgi <git@frezbo.dev> Co-authored-by: Manuel Hässig <mhaessig@users.noreply.github.com> Co-authored-by: Janek <27jf@pm.me>
2021-12-09 15:16:42 +02:00
let output = Command::new(&brl).arg("list").output_checked_utf8()?;
Add Bedrock Linux support (fix #745) (#747) * Bedrock Linux (fix #745) * Add more distributions * fix * fix * Fix * Merge * Move pacnew to the correct location * Version bump * Correct spelling for GNOME Shell extensions update (#778) * fix gnome shell extensions update object path (#788) * config: ArchPackageManager should be snake_case (#784) * config: ArchPackageManager should be snake_case * Remove unnecessary strum macro * Add arch_package_manager to config.example.toml * Add release pipeline * Run GNOME update only when using GNOME * Delete travis file and appveyor * Bump * Support rust 1.51.0 (#789) * Cross compilation * Bump * fix: GNOME detection for customized version (#790) Signed-off-by: Noel Georgi <git@frezbo.dev> * Add a flag to disable showing Arch Linux news (fix #786) * Bump * Update pacstall (fix #769) * Add an option to force vim plug update (#795) * Add an option to force vim plug update (fix #751) * Rustfmt * Update src/config.rs Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: M*C*O <mcofficer@gmx.de> * Add new step pacdiff (#796) * Add Support for Spicetify (#798) * Look for ~/.config/emacs directory in Windows (fix #766) * Pass --force to doom when -y is set (fix #799) * Implement cleanup for flatpak (#801) * Cleanup flatpak * Fix compile error * Make sure we only move our values at the very end * Access config.cleanup() through ExecutionContext * Improve man page (#803) Wordings & argument format * Avoid running remote topgrade on the current host (fix #804) (#807) * Merge the command line and the configuration flags of --only and --disable (fix #805) (#806) * Merge the command line and the configuration flags of --only and --disable (fix #805) * Fix * Fix rust requirement in the readme * Selective yes (fix #802) (#808) * Selective yes flag (fix #802) * Selective yes flag (fix #802) * selective yes * MacOS * Fix bedrock detection * Bedrock fixes * format * Fedora fixes Co-authored-by: Björn Daase <bjoern.daase@gmail.com> Co-authored-by: modularTaco <37046961+modularTaco@users.noreply.github.com> Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: Noel Georgi <git@frezbo.dev> Co-authored-by: Manuel Hässig <mhaessig@users.noreply.github.com> Co-authored-by: Janek <27jf@pm.me>
2021-12-09 15:16:42 +02:00
debug!("brl list: {:?} {:?}", output.stdout, output.stderr);
for distribution in output.stdout.trim().lines() {
Add Bedrock Linux support (fix #745) (#747) * Bedrock Linux (fix #745) * Add more distributions * fix * fix * Fix * Merge * Move pacnew to the correct location * Version bump * Correct spelling for GNOME Shell extensions update (#778) * fix gnome shell extensions update object path (#788) * config: ArchPackageManager should be snake_case (#784) * config: ArchPackageManager should be snake_case * Remove unnecessary strum macro * Add arch_package_manager to config.example.toml * Add release pipeline * Run GNOME update only when using GNOME * Delete travis file and appveyor * Bump * Support rust 1.51.0 (#789) * Cross compilation * Bump * fix: GNOME detection for customized version (#790) Signed-off-by: Noel Georgi <git@frezbo.dev> * Add a flag to disable showing Arch Linux news (fix #786) * Bump * Update pacstall (fix #769) * Add an option to force vim plug update (#795) * Add an option to force vim plug update (fix #751) * Rustfmt * Update src/config.rs Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: M*C*O <mcofficer@gmx.de> * Add new step pacdiff (#796) * Add Support for Spicetify (#798) * Look for ~/.config/emacs directory in Windows (fix #766) * Pass --force to doom when -y is set (fix #799) * Implement cleanup for flatpak (#801) * Cleanup flatpak * Fix compile error * Make sure we only move our values at the very end * Access config.cleanup() through ExecutionContext * Improve man page (#803) Wordings & argument format * Avoid running remote topgrade on the current host (fix #804) (#807) * Merge the command line and the configuration flags of --only and --disable (fix #805) (#806) * Merge the command line and the configuration flags of --only and --disable (fix #805) * Fix * Fix rust requirement in the readme * Selective yes (fix #802) (#808) * Selective yes flag (fix #802) * Selective yes flag (fix #802) * selective yes * MacOS * Fix bedrock detection * Bedrock fixes * format * Fedora fixes Co-authored-by: Björn Daase <bjoern.daase@gmail.com> Co-authored-by: modularTaco <37046961+modularTaco@users.noreply.github.com> Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: Noel Georgi <git@frezbo.dev> Co-authored-by: Manuel Hässig <mhaessig@users.noreply.github.com> Co-authored-by: Janek <27jf@pm.me>
2021-12-09 15:16:42 +02:00
debug!("Bedrock distribution {}", distribution);
match distribution {
"arch" => archlinux::upgrade_arch_linux(ctx)?,
"debian" | "ubuntu" | "linuxmint" => upgrade_debian(ctx)?,
Add Bedrock Linux support (fix #745) (#747) * Bedrock Linux (fix #745) * Add more distributions * fix * fix * Fix * Merge * Move pacnew to the correct location * Version bump * Correct spelling for GNOME Shell extensions update (#778) * fix gnome shell extensions update object path (#788) * config: ArchPackageManager should be snake_case (#784) * config: ArchPackageManager should be snake_case * Remove unnecessary strum macro * Add arch_package_manager to config.example.toml * Add release pipeline * Run GNOME update only when using GNOME * Delete travis file and appveyor * Bump * Support rust 1.51.0 (#789) * Cross compilation * Bump * fix: GNOME detection for customized version (#790) Signed-off-by: Noel Georgi <git@frezbo.dev> * Add a flag to disable showing Arch Linux news (fix #786) * Bump * Update pacstall (fix #769) * Add an option to force vim plug update (#795) * Add an option to force vim plug update (fix #751) * Rustfmt * Update src/config.rs Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: M*C*O <mcofficer@gmx.de> * Add new step pacdiff (#796) * Add Support for Spicetify (#798) * Look for ~/.config/emacs directory in Windows (fix #766) * Pass --force to doom when -y is set (fix #799) * Implement cleanup for flatpak (#801) * Cleanup flatpak * Fix compile error * Make sure we only move our values at the very end * Access config.cleanup() through ExecutionContext * Improve man page (#803) Wordings & argument format * Avoid running remote topgrade on the current host (fix #804) (#807) * Merge the command line and the configuration flags of --only and --disable (fix #805) (#806) * Merge the command line and the configuration flags of --only and --disable (fix #805) * Fix * Fix rust requirement in the readme * Selective yes (fix #802) (#808) * Selective yes flag (fix #802) * Selective yes flag (fix #802) * selective yes * MacOS * Fix bedrock detection * Bedrock fixes * format * Fedora fixes Co-authored-by: Björn Daase <bjoern.daase@gmail.com> Co-authored-by: modularTaco <37046961+modularTaco@users.noreply.github.com> Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: Noel Georgi <git@frezbo.dev> Co-authored-by: Manuel Hässig <mhaessig@users.noreply.github.com> Co-authored-by: Janek <27jf@pm.me>
2021-12-09 15:16:42 +02:00
"centos" | "fedora" => upgrade_redhat(ctx)?,
"bedrock" => upgrade_bedrock_strata(ctx)?,
_ => {
warn!("Unknown distribution {}", distribution);
}
}
}
Ok(())
}
2021-07-06 09:24:42 +03:00
fn upgrade_alpine_linux(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
2021-07-06 09:24:42 +03:00
let apk = require("apk")?;
sudo.execute(ctx, &apk)?.arg("update").status_checked()?;
sudo.execute(ctx, &apk)?.arg("upgrade").status_checked()
2021-07-06 09:24:42 +03:00
}
fn upgrade_chimera_linux(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let apk = require("apk")?;
sudo.execute(ctx, &apk)?.arg("update").status_checked()?;
sudo.execute(ctx, &apk)?.arg("upgrade").status_checked()
}
fn upgrade_wolfi_linux(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let apk = require("apk")?;
sudo.execute(ctx, &apk)?.arg("update").status_checked()?;
sudo.execute(ctx, &apk)?.arg("upgrade").status_checked()
}
2020-05-14 09:22:14 +03:00
fn upgrade_redhat(ctx: &ExecutionContext) -> Result<()> {
if let Some(bootc) = which("bootc") {
if ctx.config().bootc() {
let sudo = ctx.require_sudo()?;
return sudo.execute(ctx, &bootc)?.arg("upgrade").status_checked();
}
}
if let Some(ostree) = which("rpm-ostree") {
if ctx.config().rpm_ostree() {
let mut command = ctx.execute(ostree);
command.arg("upgrade");
return command.status_checked();
}
};
let sudo = ctx.require_sudo()?;
let dnf = require_one(["dnf", "yum"])?;
let mut command = sudo.execute(ctx, &dnf)?;
command.arg(if ctx.config().redhat_distro_sync() {
"distro-sync"
} else {
"upgrade"
});
2020-05-14 09:22:14 +03:00
if let Some(args) = ctx.config().dnf_arguments() {
command.args(args.split_whitespace());
}
if ctx.config().yes(Step::System) {
command.arg("-y");
2018-11-03 22:57:09 +02:00
}
command.status_checked()?;
2018-11-03 22:57:09 +02:00
Ok(())
}
fn upgrade_nobara(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let dnf = require("dnf")?;
let mut update_command = sudo.execute(ctx, &dnf)?;
if ctx.config().yes(Step::System) {
update_command.arg("-y");
}
update_command.arg("update");
// See https://nobaraproject.org/docs/upgrade-troubleshooting/how-do-i-update-the-system/
update_command.args([
"rpmfusion-nonfree-release",
"rpmfusion-free-release",
"fedora-repos",
"nobara-repos",
]);
update_command.arg("--refresh").status_checked()?;
let mut upgrade_command = sudo.execute(ctx, &dnf)?;
if ctx.config().yes(Step::System) {
upgrade_command.arg("-y");
}
upgrade_command.arg("distro-sync");
upgrade_command.status_checked()?;
Ok(())
}
fn upgrade_nilrt(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let opkg = require("opkg")?;
sudo.execute(ctx, &opkg)?.arg("update").status_checked()?;
sudo.execute(ctx, &opkg)?.arg("upgrade").status_checked()
}
fn upgrade_fedora_immutable(ctx: &ExecutionContext) -> Result<()> {
if let Some(bootc) = which("bootc") {
if ctx.config().bootc() {
let sudo = ctx.require_sudo()?;
return sudo.execute(ctx, &bootc)?.arg("upgrade").status_checked();
}
}
let ostree = require("rpm-ostree")?;
let mut command = ctx.execute(ostree);
command.arg("upgrade");
command.status_checked()?;
Ok(())
}
Add Bedrock Linux support (fix #745) (#747) * Bedrock Linux (fix #745) * Add more distributions * fix * fix * Fix * Merge * Move pacnew to the correct location * Version bump * Correct spelling for GNOME Shell extensions update (#778) * fix gnome shell extensions update object path (#788) * config: ArchPackageManager should be snake_case (#784) * config: ArchPackageManager should be snake_case * Remove unnecessary strum macro * Add arch_package_manager to config.example.toml * Add release pipeline * Run GNOME update only when using GNOME * Delete travis file and appveyor * Bump * Support rust 1.51.0 (#789) * Cross compilation * Bump * fix: GNOME detection for customized version (#790) Signed-off-by: Noel Georgi <git@frezbo.dev> * Add a flag to disable showing Arch Linux news (fix #786) * Bump * Update pacstall (fix #769) * Add an option to force vim plug update (#795) * Add an option to force vim plug update (fix #751) * Rustfmt * Update src/config.rs Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: M*C*O <mcofficer@gmx.de> * Add new step pacdiff (#796) * Add Support for Spicetify (#798) * Look for ~/.config/emacs directory in Windows (fix #766) * Pass --force to doom when -y is set (fix #799) * Implement cleanup for flatpak (#801) * Cleanup flatpak * Fix compile error * Make sure we only move our values at the very end * Access config.cleanup() through ExecutionContext * Improve man page (#803) Wordings & argument format * Avoid running remote topgrade on the current host (fix #804) (#807) * Merge the command line and the configuration flags of --only and --disable (fix #805) (#806) * Merge the command line and the configuration flags of --only and --disable (fix #805) * Fix * Fix rust requirement in the readme * Selective yes (fix #802) (#808) * Selective yes flag (fix #802) * Selective yes flag (fix #802) * selective yes * MacOS * Fix bedrock detection * Bedrock fixes * format * Fedora fixes Co-authored-by: Björn Daase <bjoern.daase@gmail.com> Co-authored-by: modularTaco <37046961+modularTaco@users.noreply.github.com> Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: Noel Georgi <git@frezbo.dev> Co-authored-by: Manuel Hässig <mhaessig@users.noreply.github.com> Co-authored-by: Janek <27jf@pm.me>
2021-12-09 15:16:42 +02:00
fn upgrade_bedrock_strata(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let brl = require("brl")?;
sudo.execute(ctx, &brl)?.arg("update").status_checked()?;
Add Bedrock Linux support (fix #745) (#747) * Bedrock Linux (fix #745) * Add more distributions * fix * fix * Fix * Merge * Move pacnew to the correct location * Version bump * Correct spelling for GNOME Shell extensions update (#778) * fix gnome shell extensions update object path (#788) * config: ArchPackageManager should be snake_case (#784) * config: ArchPackageManager should be snake_case * Remove unnecessary strum macro * Add arch_package_manager to config.example.toml * Add release pipeline * Run GNOME update only when using GNOME * Delete travis file and appveyor * Bump * Support rust 1.51.0 (#789) * Cross compilation * Bump * fix: GNOME detection for customized version (#790) Signed-off-by: Noel Georgi <git@frezbo.dev> * Add a flag to disable showing Arch Linux news (fix #786) * Bump * Update pacstall (fix #769) * Add an option to force vim plug update (#795) * Add an option to force vim plug update (fix #751) * Rustfmt * Update src/config.rs Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: M*C*O <mcofficer@gmx.de> * Add new step pacdiff (#796) * Add Support for Spicetify (#798) * Look for ~/.config/emacs directory in Windows (fix #766) * Pass --force to doom when -y is set (fix #799) * Implement cleanup for flatpak (#801) * Cleanup flatpak * Fix compile error * Make sure we only move our values at the very end * Access config.cleanup() through ExecutionContext * Improve man page (#803) Wordings & argument format * Avoid running remote topgrade on the current host (fix #804) (#807) * Merge the command line and the configuration flags of --only and --disable (fix #805) (#806) * Merge the command line and the configuration flags of --only and --disable (fix #805) * Fix * Fix rust requirement in the readme * Selective yes (fix #802) (#808) * Selective yes flag (fix #802) * Selective yes flag (fix #802) * selective yes * MacOS * Fix bedrock detection * Bedrock fixes * format * Fedora fixes Co-authored-by: Björn Daase <bjoern.daase@gmail.com> Co-authored-by: modularTaco <37046961+modularTaco@users.noreply.github.com> Co-authored-by: M*C*O <mcofficer@gmx.de> Co-authored-by: Noel Georgi <git@frezbo.dev> Co-authored-by: Manuel Hässig <mhaessig@users.noreply.github.com> Co-authored-by: Janek <27jf@pm.me>
2021-12-09 15:16:42 +02:00
Ok(())
}
2021-09-02 17:09:48 +00:00
fn upgrade_suse(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let zypper = require("zypper")?;
2018-11-03 22:57:09 +02:00
sudo.execute(ctx, &zypper)?.arg("refresh").status_checked()?;
let mut cmd = sudo.execute(ctx, &zypper)?;
cmd.arg(if ctx.config().suse_dup() {
"dist-upgrade"
} else {
"update"
});
if ctx.config().yes(Step::System) {
cmd.arg("-y");
}
cmd.status_checked()?;
Ok(())
}
fn upgrade_opensuse_tumbleweed(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let zypper = require("zypper")?;
sudo.execute(ctx, &zypper)?.arg("refresh").status_checked()?;
let mut cmd = sudo.execute(ctx, &zypper)?;
cmd.arg("dist-upgrade");
if ctx.config().yes(Step::System) {
cmd.arg("-y");
}
cmd.status_checked()?;
2018-11-20 14:38:23 +02:00
Ok(())
}
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
fn upgrade_suse_micro(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let upd = require("transactional-update")?;
let mut cmd = sudo.execute(ctx, &upd)?;
if ctx.config().yes(Step::System) {
cmd.arg("-n");
}
cmd.arg("dup").status_checked()?;
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
Ok(())
}
2018-11-20 14:38:23 +02:00
2022-10-17 18:48:59 +02:00
fn upgrade_openmandriva(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let dnf = require("dnf")?;
let mut command = sudo.execute(ctx, &dnf)?;
2022-10-17 18:48:59 +02:00
command.arg("upgrade");
2022-10-17 18:48:59 +02:00
if let Some(args) = ctx.config().dnf_arguments() {
command.args(args.split_whitespace());
}
2022-10-17 18:48:59 +02:00
if ctx.config().yes(Step::System) {
command.arg("-y");
2022-10-17 18:48:59 +02:00
}
command.status_checked()?;
2022-10-17 18:48:59 +02:00
Ok(())
}
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
fn upgrade_pclinuxos(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let apt_get = require("apt-get")?;
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
let mut command_update = sudo.execute(ctx, &apt_get)?;
command_update.arg("update");
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
if let Some(args) = ctx.config().dnf_arguments() {
command_update.args(args.split_whitespace());
}
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
if ctx.config().yes(Step::System) {
command_update.arg("-y");
}
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
command_update.status_checked()?;
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
let mut cmd = sudo.execute(ctx, &apt_get)?;
cmd.arg("dist-upgrade");
if ctx.config().yes(Step::System) {
cmd.arg("-y");
}
cmd.status_checked()?;
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
Ok(())
}
2022-10-17 18:48:59 +02:00
2023-05-29 19:45:11 +08:00
fn upgrade_vanilla(ctx: &ExecutionContext) -> Result<()> {
let apx = require("apx")?;
let mut update = ctx.execute(&apx);
2023-05-29 19:45:11 +08:00
update.args(["update", "--all"]);
if ctx.config().yes(Step::System) {
update.arg("-y");
}
update.status_checked()?;
let mut upgrade = ctx.execute(&apx);
2023-05-29 19:45:11 +08:00
update.args(["upgrade", "--all"]);
if ctx.config().yes(Step::System) {
upgrade.arg("-y");
}
upgrade.status_checked()?;
Ok(())
}
2021-09-02 17:09:48 +00:00
fn upgrade_void(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let xbps = require("xbps-install")?;
let mut command = sudo.execute(ctx, &xbps)?;
command.args(["-Su", "xbps"]);
if ctx.config().yes(Step::System) {
command.arg("-y");
}
command.status_checked()?;
2020-02-17 06:18:38 +00:00
let mut command = sudo.execute(ctx, &xbps)?;
command.arg("-u");
if ctx.config().yes(Step::System) {
command.arg("-y");
2018-06-12 21:28:32 +03:00
}
command.status_checked()?;
2018-06-12 21:28:32 +03:00
Ok(())
}
fn upgrade_gentoo(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let emerge = require("emerge")?;
if let Some(layman) = which("layman") {
sudo.execute(ctx, &layman)?.args(["-s", "ALL"]).status_checked()?;
}
2018-10-21 15:08:36 +03:00
println!("{}", t!("Syncing portage"));
if let Some(ego) = which("ego") {
// The Funtoo team doesn't reccomend running both ego sync and emerge --sync
sudo.execute(ctx, &ego)?.arg("sync").status_checked()?;
} else {
sudo.execute(ctx, &emerge)?
.arg("--sync")
.args(
ctx.config()
.emerge_sync_flags()
.map(|s| s.split_whitespace().collect())
.unwrap_or_else(|| vec!["-q"]),
)
.status_checked()?;
}
2018-10-21 15:08:36 +03:00
if let Some(eix_update) = which("eix-update") {
sudo.execute(ctx, &eix_update)?.status_checked()?;
2018-10-21 15:08:36 +03:00
}
sudo.execute(ctx, &emerge)?
.args(
ctx.config()
.emerge_update_flags()
.map(|s| s.split_whitespace().collect())
.unwrap_or_else(|| vec!["-uDNa", "--with-bdeps=y", "world"]),
)
.status_checked()?;
2018-10-21 15:08:36 +03:00
Ok(())
}
2021-04-06 10:54:23 +03:00
fn upgrade_debian(ctx: &ExecutionContext) -> Result<()> {
2023-06-05 14:38:14 +08:00
let apt = which("apt-fast")
.or_else(|| {
if which("mist").is_some() {
Some(PathBuf::from("mist"))
} else {
None
}
})
.or_else(|| {
if Path::new("/usr/bin/nala").exists() {
Some(Path::new("/usr/bin/nala").to_path_buf())
} else {
None
}
})
.unwrap_or_else(|| PathBuf::from("apt-get"));
let is_mist = apt.ends_with("mist");
let is_nala = apt.ends_with("nala");
2023-06-05 14:38:14 +08:00
// MIST does not require `sudo`
if is_mist {
ctx.execute(&apt).arg("update").status_checked()?;
ctx.execute(&apt).arg("upgrade").status_checked()?;
2023-06-05 14:38:14 +08:00
// Simply return as MIST does not have `clean` and `autoremove`
// subcommands, neither the `-y` option (for now maybe?).
return Ok(());
}
let sudo = ctx.require_sudo()?;
if !is_nala {
sudo.execute(ctx, &apt)?
.arg("update")
.status_checked_with_codes(&[0, 100])?;
}
let mut command = sudo.execute(ctx, &apt)?;
if is_nala {
command.arg("upgrade");
} else {
command.arg("dist-upgrade");
};
if ctx.config().yes(Step::System) {
command.arg("-y");
}
if let Some(args) = ctx.config().apt_arguments() {
command.args(args.split_whitespace());
}
command.status_checked()?;
if ctx.config().cleanup() {
sudo.execute(ctx, &apt)?.arg("clean").status_checked()?;
let mut command = sudo.execute(ctx, &apt)?;
command.arg("autoremove");
if ctx.config().yes(Step::System) {
command.arg("-y");
}
command.status_checked()?;
2018-06-12 21:28:32 +03:00
}
Ok(())
}
2018-06-28 12:16:54 +03:00
2022-05-07 09:14:20 +03:00
pub fn run_deb_get(ctx: &ExecutionContext) -> Result<()> {
let deb_get = require("deb-get")?;
print_separator("deb-get");
ctx.execute(&deb_get).arg("update").status_checked()?;
ctx.execute(&deb_get).arg("upgrade").status_checked()?;
2022-05-07 09:14:20 +03:00
if ctx.config().cleanup() {
let output = ctx.execute(&deb_get).arg("clean").output_checked()?;
2025-04-13 10:36:22 +02:00
// Swallow the output, as it's very noisy and not useful.
// The output is automatically printed as part of `output_checked` when an error occurs.
println!("{}", t!("<output from `deb-get clean` omitted>"));
debug!("`deb-get clean` output: {output:?}");
2022-05-07 09:14:20 +03:00
}
Ok(())
}
2021-09-02 17:09:48 +00:00
fn upgrade_solus(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let eopkg = require("eopkg")?;
let mut cmd = sudo.execute(ctx, &eopkg)?;
if ctx.config().yes(Step::System) {
cmd.arg("-y");
}
cmd.arg("upgrade").status_checked()?;
2019-03-21 10:36:40 -07:00
Ok(())
}
pub fn run_am(ctx: &ExecutionContext) -> Result<()> {
2023-01-29 21:53:26 +00:00
let am = require("am")?;
2023-05-31 15:01:45 +08:00
print_separator("AM");
let mut am = ctx.execute(am);
2023-05-31 15:01:45 +08:00
if ctx.config().yes(Step::AM) {
am.arg("-U");
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
} else {
2023-05-31 15:01:45 +08:00
am.arg("-u");
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
}
2023-05-31 15:01:45 +08:00
am.status_checked()
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
}
2023-05-09 14:03:06 +08:00
pub fn run_appman(ctx: &ExecutionContext) -> Result<()> {
let appman = require("appman")?;
print_separator("appman");
ctx.execute(appman).arg("-u").status_checked()
2023-05-09 14:03:06 +08:00
}
pub fn run_pacdef(ctx: &ExecutionContext) -> Result<()> {
let pacdef = require("pacdef")?;
print_separator("pacdef");
let output = ctx.execute(&pacdef).arg("version").output_checked()?;
2023-02-23 23:01:53 +01:00
let string = String::from_utf8(output.stdout)?;
let new_version = string.contains("version: 1");
2023-02-23 23:01:53 +01:00
if new_version {
let mut cmd = ctx.execute(&pacdef);
cmd.args(["package", "sync"]);
if ctx.config().yes(Step::System) {
cmd.arg("--noconfirm");
}
cmd.status_checked()?;
2023-02-23 23:01:53 +01:00
println!();
ctx.execute(&pacdef).args(["package", "review"]).status_checked()?;
2023-02-23 23:01:53 +01:00
} else {
let mut cmd = ctx.execute(&pacdef);
cmd.arg("sync");
if ctx.config().yes(Step::System) {
cmd.arg("--noconfirm");
}
cmd.status_checked()?;
2023-02-23 23:01:53 +01:00
println!();
ctx.execute(&pacdef).arg("review").status_checked()?;
2023-02-23 23:01:53 +01:00
}
Ok(())
}
2021-10-25 21:33:58 +03:00
pub fn run_pacstall(ctx: &ExecutionContext) -> Result<()> {
let pacstall = require("pacstall")?;
2022-01-06 21:41:36 +02:00
print_separator("Pacstall");
let mut update_cmd = ctx.execute(&pacstall);
let mut upgrade_cmd = ctx.execute(pacstall);
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
if ctx.config().yes(Step::Pacstall) {
update_cmd.arg("-P");
upgrade_cmd.arg("-P");
}
update_cmd.arg("-U").status_checked()?;
upgrade_cmd.arg("-Up").status_checked()
2021-10-25 21:33:58 +03:00
}
pub fn run_packer_nu(ctx: &ExecutionContext) -> Result<()> {
let nu = require("nu")?;
let packer_home = HOME_DIR.join(".local/share/nushell/packer");
packer_home.clone().require()?;
print_separator("packer.nu");
ctx.execute(nu)
.env("PWD", "/")
.env("NU_PACKER_HOME", packer_home)
.args([
"-c",
"use ~/.local/share/nushell/packer/start/packer.nu/api_layer/packer.nu; packer update",
])
.status_checked()
}
2021-09-02 17:09:48 +00:00
fn upgrade_clearlinux(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let swupd = require("swupd")?;
let mut cmd = sudo.execute(ctx, &swupd)?;
cmd.arg("update");
if ctx.config().yes(Step::System) {
cmd.arg("--assume=yes");
}
cmd.status_checked()?;
Ok(())
}
2021-09-02 17:09:48 +00:00
fn upgrade_exherbo(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let cave = require("cave")?;
let eclectic = require("eclectic")?;
sudo.execute(ctx, &cave)?.arg("sync").status_checked()?;
sudo.execute(ctx, &cave)?
.args(["resolve", "world", "-c1", "-Cs", "-km", "-Km", "-x"])
.status_checked()?;
if ctx.config().cleanup() {
sudo.execute(ctx, &cave)?.args(["purge", "-x"]).status_checked()?;
}
sudo.execute(ctx, &cave)?
.args(["fix-linkage", "-x", "--", "-Cs"])
.status_checked()?;
sudo.execute(ctx, &eclectic)?
.args(["config", "interactive"])
.status_checked()?;
Ok(())
}
2021-09-02 17:09:48 +00:00
fn upgrade_nixos(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let mut command = sudo.execute(ctx, "/run/current-system/sw/bin/nixos-rebuild")?;
command.args(["switch", "--upgrade"]);
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
if let Some(args) = ctx.config().nix_arguments() {
command.args(args.split_whitespace());
}
command.status_checked()?;
if ctx.config().cleanup() {
sudo.execute(ctx, "/run/current-system/sw/bin/nix-collect-garbage")?
.arg("-d")
.status_checked()?;
}
Ok(())
}
fn upgrade_neon(ctx: &ExecutionContext) -> Result<()> {
// KDE neon is ubuntu based but uses it's own manager, pkcon
// running apt update with KDE neon is an error
// in theory rpm based distributions use pkcon as well, though that
// seems rare
// if that comes up we need to create a Distribution::PackageKit or some such
let sudo = ctx.require_sudo()?;
let pkcon = require("pkcon")?;
// pkcon ignores update with update and refresh provided together
sudo.execute(ctx, &pkcon)?.arg("refresh").status_checked()?;
let mut exe = sudo.execute(ctx, &pkcon)?;
let cmd = exe.arg("update");
if ctx.config().yes(Step::System) {
cmd.arg("-y");
}
if ctx.config().cleanup() {
cmd.arg("--autoremove");
}
// from pkcon man, exit code 5 is 'Nothing useful was done.'
cmd.status_checked_with_codes(&[5])?;
Ok(())
}
/// `needrestart` should be skipped if:
///
/// 1. This is a redhat-based distribution
/// 2. This is a debian-based distribution and it is using `nala` as the `apt`
/// alternative
fn should_skip_needrestart() -> Result<()> {
let distribution = Distribution::detect()?;
let msg = t!("needrestart will be ran by the package manager");
if distribution.redhat_based() {
return Err(SkipStep(String::from(msg)).into());
}
if matches!(distribution, Distribution::Debian) {
let apt = which("apt-fast")
.or_else(|| {
if which("mist").is_some() {
Some(PathBuf::from("mist"))
} else {
None
}
})
.or_else(|| {
if Path::new("/usr/bin/nala").exists() {
Some(Path::new("/usr/bin/nala").to_path_buf())
} else {
None
}
})
.unwrap_or_else(|| PathBuf::from("apt-get"));
let is_nala = apt.ends_with("nala");
if is_nala {
return Err(SkipStep(String::from(msg)).into());
}
}
2018-06-28 12:16:54 +03:00
Ok(())
}
pub fn run_needrestart(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let needrestart = require("needrestart")?;
should_skip_needrestart()?;
print_separator(t!("Check for needed restarts"));
2018-06-28 12:16:54 +03:00
sudo.execute(ctx, &needrestart)?.status_checked()?;
2018-08-19 14:45:23 +03:00
2019-02-11 14:10:06 +02:00
Ok(())
2018-06-28 12:16:54 +03:00
}
pub fn run_fwupdmgr(ctx: &ExecutionContext) -> Result<()> {
2019-02-25 15:10:28 +02:00
let fwupdmgr = require("fwupdmgr")?;
2020-06-11 19:11:57 +03:00
if is_wsl()? {
return Err(SkipStep(t!("Should not run in WSL").to_string()).into());
2020-06-11 19:11:57 +03:00
}
print_separator(t!("Firmware upgrades"));
2018-08-19 14:45:23 +03:00
ctx.execute(&fwupdmgr).arg("refresh").status_checked_with_codes(&[2])?;
let mut updmgr = ctx.execute(&fwupdmgr);
if ctx.config().firmware_upgrade() {
updmgr.arg("update");
if ctx.config().yes(Step::System) {
updmgr.arg("-y");
}
} else {
updmgr.arg("get-updates");
}
updmgr.status_checked_with_codes(&[2])
2018-06-28 12:16:54 +03:00
}
pub fn run_flatpak(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
2019-02-25 15:10:28 +02:00
let flatpak = require("flatpak")?;
let cleanup = ctx.config().cleanup();
let yes = ctx.config().yes(Step::Flatpak);
2019-02-25 15:10:28 +02:00
print_separator("Flatpak User Packages");
let mut update_args = vec!["update", "--user"];
if yes {
update_args.push("-y");
}
ctx.execute(&flatpak).args(&update_args).status_checked()?;
if cleanup {
let mut cleanup_args = vec!["uninstall", "--user", "--unused"];
if yes {
cleanup_args.push("-y");
}
ctx.execute(&flatpak).args(&cleanup_args).status_checked()?;
}
print_separator(t!("Flatpak System Packages"));
if ctx.config().flatpak_use_sudo() || std::env::var("SSH_CLIENT").is_ok() {
let mut update_args = vec!["update", "--system"];
if yes {
update_args.push("-y");
}
sudo.execute(ctx, &flatpak)?.args(&update_args).status_checked()?;
if cleanup {
let mut cleanup_args = vec!["uninstall", "--system", "--unused"];
if yes {
cleanup_args.push("-y");
}
sudo.execute(ctx, &flatpak)?.args(&cleanup_args).status_checked()?;
}
} else {
let mut update_args = vec!["update", "--system"];
if yes {
update_args.push("-y");
}
ctx.execute(&flatpak).args(&update_args).status_checked()?;
if cleanup {
let mut cleanup_args = vec!["uninstall", "--system", "--unused"];
if yes {
cleanup_args.push("-y");
}
ctx.execute(flatpak).args(&cleanup_args).status_checked()?;
}
}
Ok(())
}
pub fn run_snap(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
2019-02-25 15:10:28 +02:00
let snap = require("snap")?;
2019-09-10 22:59:08 +03:00
if !PathBuf::from("/var/snapd.socket").exists() && !PathBuf::from("/run/snapd.socket").exists() {
return Err(SkipStep(t!("Snapd socket does not exist").to_string()).into());
2018-08-19 14:45:23 +03:00
}
2019-02-25 15:10:28 +02:00
print_separator("snap");
2018-08-19 14:45:23 +03:00
sudo.execute(ctx, &snap)?.arg("refresh").status_checked()
2018-06-28 12:16:54 +03:00
}
2018-10-02 13:25:02 +03:00
pub fn run_pihole_update(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
let pihole = require("pihole")?;
Path::new("/opt/pihole/update.sh").require()?;
print_separator("pihole");
sudo.execute(ctx, &pihole)?.arg("-up").status_checked()
}
2022-10-14 16:46:21 +02:00
pub fn run_protonup_update(ctx: &ExecutionContext) -> Result<()> {
2022-10-14 16:56:03 +02:00
let protonup = require("protonup")?;
print_separator("protonup");
let mut cmd = ctx.execute(protonup);
2023-09-30 16:44:20 +08:00
if ctx.config().yes(Step::Protonup) {
cmd.arg("--yes");
}
cmd.status_checked()?;
2022-10-14 16:56:03 +02:00
Ok(())
2022-10-14 16:46:21 +02:00
}
2022-10-27 00:12:38 +02:00
pub fn run_distrobox_update(ctx: &ExecutionContext) -> Result<()> {
let distrobox = require("distrobox")?;
2022-10-28 00:29:35 +02:00
print_separator("Distrobox");
match (
match (
ctx.execute(distrobox).arg("upgrade"),
2022-10-28 00:29:35 +02:00
ctx.config().distrobox_containers(),
) {
(r, Some(c)) => {
if c.is_empty() {
return Err(SkipStep(t!("You need to specify at least one container").to_string()).into());
2022-10-28 00:29:35 +02:00
}
r.args(c)
}
(r, None) => r.arg("--all"),
},
ctx.config().distrobox_root(),
) {
(r, true) => r.arg("--root"),
(r, false) => r,
}
.status_checked()
2022-10-27 00:12:38 +02:00
}
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
pub fn run_dkp_pacman_update(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
let dkp_pacman = require("dkp-pacman")?;
print_separator("Devkitpro pacman");
sudo.execute(ctx, &dkp_pacman)?.arg("-Syu").status_checked()?;
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
if ctx.config().cleanup() {
sudo.execute(ctx, &dkp_pacman)?.arg("-Scc").status_checked()?;
v10.2.5 release (#330) * Don't show desktop notification on error (if `skip_notify = true`) (#275) * Use ─ (U+2500) to draw borders (#282) * Adds Pclinuxos support (#283) * Add Devkitpro Pacman support (#291) * Added support for Neovim package manager lazy.nvim (#293) * Added support for lazy.nvim From https://github.com/folke/lazy.nvim Authored-by: Jacob Lane Ledbetter <jledbetter460@gmail.com> * Make garuda-update update AUR packages by default (#296) * fix(#298): Don't throw error if no Helm repository found (#305) * Skip .NET when `dotnet tool list` is not successful (#302) * feat(pacstall): add `-y` flag variant (#312) * Add openSUSE MicroOS support (#315) * Adds notify-send timeout of 10s (#318) * Don't run yum when rpm-ostree is available (#313) * don't run yum when rpm-ostree is available * Clippy fix * rpm-ostree: set default value to true * Fixes if loop error * Fixes gem update --system requires sudo now (#317) * Fixes gem update --system requires sudo now * rubygem: Adds arg -EH to sudo * Use fixed nala path instead of which(nala) (#314) * Adds notify-send bug warning when topgrade is run (#324) * Adds notify-send bug warning when topgrade is run * fix typo + clippy * notify-send warning respects skip_notify flag * nix: Adds additional arguments support (#325) * Adds pip-review and pipupgrade support (#316) * Adds pip-review and pipupgrade support * Python: fixes pip_review and pipupgrade * v10.2.5 patch (#329) * WSL: Adds new wsl --update flags (#327) * wsl: Updates available flags * Clippy fix * Add WslUpdate runner * wsl: Code Typo * wsl: Code Typos * wsl: Code Typos * wsl: Code Typo * Adds AM Package Manager (#328) * Adds AM Package Manager * Clippy fixes * Cargo fmt * Moves am to linux only in main file --------- Co-authored-by: Guilherme Silva <626206+guihkx@users.noreply.github.com> Co-authored-by: Gabriel Augendre <gabriel@augendre.info> Co-authored-by: Cat Core <34719527+arthurbambou@users.noreply.github.com> Co-authored-by: Hugo Haas <hugoh@hugoh.net> Co-authored-by: Baptiste <32563450+BapRx@users.noreply.github.com> Co-authored-by: bbx0 <39773919+bbx0@users.noreply.github.com> Co-authored-by: Sourajyoti Basak <wiz28@protonmail.com>
2023-01-29 19:19:27 +00:00
}
Ok(())
}
pub fn run_config_update(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
if ctx.config().yes(Step::ConfigUpdate) {
return Err(SkipStep(t!("Skipped in --yes").to_string()).into());
}
2018-10-02 13:25:02 +03:00
2021-12-18 20:20:00 +02:00
if let Ok(etc_update) = require("etc-update") {
print_separator(t!("Configuration update"));
sudo.execute(ctx, etc_update)?.status_checked()?;
2021-12-18 20:20:00 +02:00
} else if let Ok(pacdiff) = require("pacdiff") {
if std::env::var("DIFFPROG").is_err() {
require("vim")?;
}
2021-11-06 19:55:38 +01:00
print_separator(t!("Configuration update"));
sudo.execute_opts(
ctx,
&pacdiff,
SudoExecuteOpts {
preserve_env: Some(&["DIFFPROG"]),
..Default::default()
},
)?
.status_checked()?;
2021-12-18 20:20:00 +02:00
}
2021-11-06 19:55:38 +01:00
2021-12-18 20:20:00 +02:00
Ok(())
2021-11-06 19:55:38 +01:00
}
2023-08-15 08:36:20 +08:00
pub fn run_lure_update(ctx: &ExecutionContext) -> Result<()> {
let lure = require("lure")?;
print_separator("LURE");
let mut exe = ctx.execute(lure);
2023-08-15 08:36:20 +08:00
if ctx.config().yes(Step::Lure) {
exe.args(["-i=false", "up"]);
} else {
exe.arg("up");
}
exe.status_checked()
}
2024-02-16 11:57:53 +08:00
pub fn run_waydroid(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
2024-02-16 11:57:53 +08:00
let waydroid = require("waydroid")?;
let status = ctx.execute(&waydroid).arg("status").output_checked_utf8()?;
2024-02-16 11:57:53 +08:00
// example output of `waydroid status`:
//
// ```sh
// $ waydroid status
// Session: RUNNING
// Container: RUNNING
// Vendor type: MAINLINE
// IP address: 192.168.240.112
// Session user: w568w(1000)
// Wayland display: wayland-0
// ```
//
// ```sh
// $ waydroid status
// Session: STOPPED
// Vendor type: MAINLINE
// ```
let session = status
.stdout
.lines()
.find(|line| line.contains("Session:"))
.unwrap_or_else(|| panic!("the output of `waydroid status` should contain `Session:`"));
2024-02-16 11:57:53 +08:00
let is_container_running = session.contains("RUNNING");
let assume_yes = ctx.config().yes(Step::Waydroid);
print_separator("Waydroid");
if is_container_running && !assume_yes {
let update_allowed = prompt_yesno(&t!(
"Going to execute `waydroid upgrade`, which would STOP the running container, is this ok?"
))?;
2024-02-16 11:57:53 +08:00
if !update_allowed {
return Err(
SkipStep(t!("Skip the Waydroid step because the user don't want to proceed").to_string()).into(),
);
2024-02-16 11:57:53 +08:00
}
}
sudo.execute(ctx, &waydroid)?.arg("upgrade").status_checked()
2024-02-16 11:57:53 +08:00
}
2024-05-18 16:34:03 +08:00
pub fn run_auto_cpufreq(ctx: &ExecutionContext) -> Result<()> {
let sudo = ctx.require_sudo()?;
2024-05-18 16:34:03 +08:00
let auto_cpu_freq = require("auto-cpufreq")?;
print_separator("auto-cpufreq");
sudo.execute(ctx, &auto_cpu_freq)?.arg("--update").status_checked()
}
pub fn run_cinnamon_spices_updater(ctx: &ExecutionContext) -> Result<()> {
let cinnamon_spice_updater = require("cinnamon-spice-updater")?;
print_separator("Cinnamon spices");
ctx.execute(cinnamon_spice_updater).arg("--update-all").status_checked()
2024-05-18 16:34:03 +08:00
}
#[cfg(test)]
mod tests {
use super::*;
fn test_template(os_release_file: &str, expected_distribution: Distribution) {
let os_release = Ini::load_from_str(os_release_file).unwrap();
assert_eq!(
Distribution::parse_os_release(&os_release).unwrap(),
expected_distribution
);
}
#[test]
fn test_wolfi() {
test_template(include_str!("os_release/wolfi"), Distribution::Wolfi);
}
#[test]
fn test_arch_linux() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/arch"), Distribution::Arch);
test_template(include_str!("os_release/arch32"), Distribution::Arch);
}
#[test]
fn test_centos() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/centos"), Distribution::CentOS);
}
2020-03-13 06:48:46 -04:00
#[test]
fn test_rhel() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/rhel"), Distribution::CentOS);
2020-03-13 06:48:46 -04:00
}
#[test]
fn test_clearlinux() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/clearlinux"), Distribution::ClearLinux);
}
#[test]
fn test_debian() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/debian"), Distribution::Debian);
}
#[test]
fn test_ubuntu() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/ubuntu"), Distribution::Debian);
}
#[test]
fn test_mint() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/mint"), Distribution::Debian);
}
#[test]
fn test_opensuse() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/opensuse"), Distribution::Suse);
}
#[test]
fn test_oraclelinux() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/oracle"), Distribution::CentOS);
}
#[test]
fn test_fedora() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/fedora"), Distribution::Fedora);
}
#[test]
fn test_fedora_immutable() {
test_template(
include_str!("os_release/fedorasilverblue"),
Distribution::FedoraImmutable,
);
test_template(include_str!("os_release/fedorakinoite"), Distribution::FedoraImmutable);
test_template(include_str!("os_release/fedoraonyx"), Distribution::FedoraImmutable);
test_template(include_str!("os_release/fedorasericea"), Distribution::FedoraImmutable);
test_template(include_str!("os_release/fedoraiot"), Distribution::FedoraImmutable);
test_template(
include_str!("os_release/fedoraswayatomic"),
Distribution::FedoraImmutable,
);
}
#[test]
fn test_manjaro() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/manjaro"), Distribution::Arch);
}
#[test]
fn test_manjaro_arm() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/manjaro-arm"), Distribution::Arch);
}
#[test]
fn test_gentoo() {
2021-09-02 13:04:30 +00:00
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() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/exherbo"), Distribution::Exherbo);
}
2020-03-26 17:07:48 +02:00
#[test]
fn test_amazon_linux() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/amazon_linux"), Distribution::CentOS);
2020-03-26 17:07:48 +02:00
}
#[test]
fn test_nixos() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/nixos"), Distribution::NixOS);
}
#[test]
fn test_fedoraremixonwsl() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/fedoraremixforwsl"), Distribution::Fedora);
}
#[test]
fn test_pengwinonwsl() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/pengwinonwsl"), Distribution::Debian);
}
#[test]
fn test_artix() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/artix"), Distribution::Arch);
}
2020-08-29 07:24:00 +03:00
#[test]
fn test_garuda() {
2021-09-02 13:04:30 +00:00
test_template(include_str!("os_release/garuda"), Distribution::Arch);
2020-08-29 07:24:00 +03:00
}
2021-10-15 06:15:38 +03:00
#[test]
fn test_pureos() {
test_template(include_str!("os_release/pureos"), Distribution::Debian);
}
2023-05-27 17:41:51 +08:00
#[test]
fn test_deepin() {
test_template(include_str!("os_release/deepin"), Distribution::Debian);
}
2023-05-29 19:45:11 +08:00
#[test]
fn test_vanilla() {
test_template(include_str!("os_release/vanilla"), Distribution::Vanilla);
}
2023-07-17 13:31:46 +08:00
#[test]
fn test_solus() {
test_template(include_str!("os_release/solus"), Distribution::Solus);
}
#[test]
fn test_nobara() {
test_template(include_str!("os_release/nobara"), Distribution::Nobara);
}
#[test]
fn test_nilrt() {
test_template(include_str!("os_release/nilrt"), Distribution::NILRT);
}
#[test]
fn test_coreos() {
test_template(include_str!("os_release/coreos"), Distribution::FedoraImmutable);
}
#[test]
fn test_aurora() {
test_template(include_str!("os_release/aurora"), Distribution::FedoraImmutable);
}
#[test]
fn test_bluefin() {
test_template(include_str!("os_release/bluefin"), Distribution::FedoraImmutable);
}
#[test]
fn test_bazzite() {
test_template(include_str!("os_release/bazzite"), Distribution::FedoraImmutable);
}
#[test]
fn test_cachyos() {
test_template(include_str!("os_release/cachyos"), Distribution::Arch);
}
}