committed by
GitHub
parent
d48182e6bd
commit
417ca1257a
@@ -455,13 +455,12 @@ fn upgrade_nixos(sudo: &Option<PathBuf>, cleanup: bool, run_type: RunType) -> Re
|
||||
}
|
||||
|
||||
pub fn run_needrestart(sudo: Option<&PathBuf>, run_type: RunType) -> Result<()> {
|
||||
let sudo = require_option(sudo)?;
|
||||
let sudo = require_option(sudo, String::from("sudo is not installed"))?;
|
||||
let needrestart = require("needrestart")?;
|
||||
let distribution = Distribution::detect()?;
|
||||
|
||||
if distribution.redhat_based() {
|
||||
debug!("Skipping needrestart on Redhat based distributions");
|
||||
return Err(SkipStep.into());
|
||||
return Err(SkipStep(String::from("needrestart will be ran by the package manager")).into());
|
||||
}
|
||||
|
||||
print_separator("Check for needed restarts");
|
||||
@@ -475,7 +474,7 @@ pub fn run_fwupdmgr(run_type: RunType) -> Result<()> {
|
||||
let fwupdmgr = require("fwupdmgr")?;
|
||||
|
||||
if is_wsl()? {
|
||||
return Err(SkipStep.into());
|
||||
return Err(SkipStep(String::from("Should not run in WSL")).into());
|
||||
}
|
||||
|
||||
print_separator("Firmware upgrades");
|
||||
@@ -508,11 +507,11 @@ pub fn flatpak_update(run_type: RunType) -> Result<()> {
|
||||
}
|
||||
|
||||
pub fn run_snap(sudo: Option<&PathBuf>, run_type: RunType) -> Result<()> {
|
||||
let sudo = require_option(sudo)?;
|
||||
let sudo = require_option(sudo, String::from("sudo is not installed"))?;
|
||||
let snap = require("snap")?;
|
||||
|
||||
if !PathBuf::from("/var/snapd.socket").exists() && !PathBuf::from("/run/snapd.socket").exists() {
|
||||
return Err(SkipStep.into());
|
||||
return Err(SkipStep(String::from("Snapd socket does not exist")).into());
|
||||
}
|
||||
print_separator("snap");
|
||||
|
||||
@@ -520,7 +519,7 @@ pub fn run_snap(sudo: Option<&PathBuf>, run_type: RunType) -> Result<()> {
|
||||
}
|
||||
|
||||
pub fn run_pihole_update(sudo: Option<&PathBuf>, run_type: RunType) -> Result<()> {
|
||||
let sudo = require_option(sudo)?;
|
||||
let sudo = require_option(sudo, String::from("sudo is not installed"))?;
|
||||
let pihole = require("pihole")?;
|
||||
Path::new("/opt/pihole/update.sh").require()?;
|
||||
|
||||
@@ -530,7 +529,7 @@ pub fn run_pihole_update(sudo: Option<&PathBuf>, run_type: RunType) -> Result<()
|
||||
}
|
||||
|
||||
pub fn run_etc_update(sudo: Option<&PathBuf>, run_type: RunType) -> Result<()> {
|
||||
let sudo = require_option(sudo)?;
|
||||
let sudo = require_option(sudo, String::from("sudo is not installed"))?;
|
||||
let etc_update = require("etc-update")?;
|
||||
print_separator("etc-update");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user