UI cleanup.
This commit is contained in:
parent
bf40108d4d
commit
49f6b0fc36
2 changed files with 49 additions and 238 deletions
|
@ -13,20 +13,22 @@ fn trim_newline(s: &mut String) {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
{
|
{
|
||||||
|
//Clear termianl, and move cursor to 1,1 inside the terminal
|
||||||
|
print!("{esc}[2J{esc}[1;1H", esc = 27 as char);
|
||||||
|
|
||||||
// Tell user that we are going to start the update procedure
|
// Tell user that we are going to start the update procedure
|
||||||
cprintln!("<bold><rev><white>osupdater : rust edition</white></rev></bold>\n");
|
cprintln!("<bold><rev>osupdater : rust edition -- This tool will locate and run any package managers on your system.</rev></bold>\n");
|
||||||
cprintln!("<bold><rev><white>This tool will locate any package managers on your system and run the update tool appropriate to it.</white></rev></bold>\n");
|
cprintln!("<bold><rev>Looking for native package managers.</rev></bold>\n");
|
||||||
cprintln!("<bold><rev><white>Looking for native package managers.</white></rev></bold>\n");
|
|
||||||
let find_sudo = Command::new("which")
|
let find_sudo = Command::new("which")
|
||||||
.arg("sudo").stdout(Stdio::piped()).output().unwrap();
|
.arg("sudo").stdout(Stdio::piped()).output().unwrap();
|
||||||
let mut sudo_bin = String::from_utf8(find_sudo.stdout).unwrap();
|
let mut sudo_bin = String::from_utf8(find_sudo.stdout).unwrap();
|
||||||
trim_newline(&mut sudo_bin);
|
trim_newline(&mut sudo_bin);
|
||||||
|
|
||||||
let find_apt = Command::new("which")
|
let find_apt = Command::new("which")
|
||||||
.arg("apt").stdout(Stdio::piped()).output().unwrap();
|
.arg("apt").stdout(Stdio::piped()).output().unwrap();
|
||||||
let mut apt_bin = String::from_utf8(find_apt.stdout).unwrap();
|
let mut apt_bin = String::from_utf8(find_apt.stdout).unwrap();
|
||||||
trim_newline(&mut apt_bin);
|
trim_newline(&mut apt_bin);
|
||||||
|
|
||||||
let find_dnf5 = Command::new("which")
|
let find_dnf5 = Command::new("which")
|
||||||
.arg("dnf5").stdout(Stdio::piped()).output().unwrap();
|
.arg("dnf5").stdout(Stdio::piped()).output().unwrap();
|
||||||
let mut dnf5_bin = String::from_utf8(find_dnf5.stdout).unwrap();
|
let mut dnf5_bin = String::from_utf8(find_dnf5.stdout).unwrap();
|
||||||
|
@ -46,12 +48,12 @@ fn main() {
|
||||||
.arg("urpmi").stdout(Stdio::piped()).output().unwrap();
|
.arg("urpmi").stdout(Stdio::piped()).output().unwrap();
|
||||||
let mut urpmi_bin = String::from_utf8(find_urpmi.stdout).unwrap();
|
let mut urpmi_bin = String::from_utf8(find_urpmi.stdout).unwrap();
|
||||||
trim_newline(&mut urpmi_bin);
|
trim_newline(&mut urpmi_bin);
|
||||||
|
|
||||||
let find_zypper = Command::new("which")
|
let find_zypper = Command::new("which")
|
||||||
.arg("zypper").stdout(Stdio::piped()).output().unwrap();
|
.arg("zypper").stdout(Stdio::piped()).output().unwrap();
|
||||||
let mut zypper_bin = String::from_utf8(find_zypper.stdout).unwrap();
|
let mut zypper_bin = String::from_utf8(find_zypper.stdout).unwrap();
|
||||||
trim_newline(&mut zypper_bin);
|
trim_newline(&mut zypper_bin);
|
||||||
|
|
||||||
let find_flatpak = Command::new("which")
|
let find_flatpak = Command::new("which")
|
||||||
.arg("flatpak").stdout(Stdio::piped()).output().unwrap();
|
.arg("flatpak").stdout(Stdio::piped()).output().unwrap();
|
||||||
let mut flatpak_bin = String::from_utf8(find_flatpak.stdout).unwrap();
|
let mut flatpak_bin = String::from_utf8(find_flatpak.stdout).unwrap();
|
||||||
|
@ -60,36 +62,36 @@ fn main() {
|
||||||
let find_snap = Command::new("which")
|
let find_snap = Command::new("which")
|
||||||
.arg("snap").stdout(Stdio::piped()).output().unwrap();
|
.arg("snap").stdout(Stdio::piped()).output().unwrap();
|
||||||
let mut snap_bin = String::from_utf8(find_snap.stdout).unwrap();
|
let mut snap_bin = String::from_utf8(find_snap.stdout).unwrap();
|
||||||
trim_newline(&mut snap_bin);
|
trim_newline(&mut snap_bin);
|
||||||
|
|
||||||
let find_pip_review = Command::new("which")
|
let find_pip_review = Command::new("which")
|
||||||
.arg("pip-review").stdout(Stdio::piped()).output().unwrap();
|
.arg("pip-review").stdout(Stdio::piped()).output().unwrap();
|
||||||
let mut pip_review_bin = String::from_utf8(find_pip_review.stdout).unwrap();
|
let mut pip_review_bin = String::from_utf8(find_pip_review.stdout).unwrap();
|
||||||
trim_newline(&mut pip_review_bin);
|
trim_newline(&mut pip_review_bin);
|
||||||
|
|
||||||
//apt
|
//apt
|
||||||
cprintln!("<bold><rev><magenta>Checking for apt</magenta></rev></bold>");
|
|
||||||
let path = Path::new(&apt_bin);
|
let path = Path::new(&apt_bin);
|
||||||
if path.exists(){
|
if path.exists(){
|
||||||
let mut cmd =
|
cprintln!("<bold><rev>Updating via: apt</rev></bold>");
|
||||||
|
let mut cmd =
|
||||||
Command::new(&sudo_bin)
|
Command::new(&sudo_bin)
|
||||||
.arg(&apt_bin).arg("update").arg("-y")
|
.arg(&apt_bin).arg("update").arg("-y")
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
||||||
.spawn().unwrap();
|
.spawn().unwrap();
|
||||||
let _output = cmd.wait();
|
let _output = cmd.wait();
|
||||||
let mut cmd =
|
let mut cmd =
|
||||||
Command::new(&sudo_bin)
|
Command::new(&sudo_bin)
|
||||||
.arg(&apt_bin).arg("upgrade").arg("-y")
|
.arg(&apt_bin).arg("upgrade").arg("-y")
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
||||||
.spawn().unwrap();
|
.spawn().unwrap();
|
||||||
let _output = cmd.wait();
|
let _output = cmd.wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
// dnf
|
// dnf
|
||||||
cprintln!("<bold><rev><blue>Checking for dnf</blue></rev></bold>");
|
|
||||||
let path = Path::new(&dnf_bin);
|
let path = Path::new(&dnf_bin);
|
||||||
if path.exists(){
|
if path.exists(){
|
||||||
let mut cmd =
|
cprintln!("<bold><rev>Updating via: dnf</rev></bold>");
|
||||||
|
let mut cmd =
|
||||||
Command::new(&sudo_bin)
|
Command::new(&sudo_bin)
|
||||||
.arg(&dnf_bin).arg("--refresh").arg("--skip-broken").arg("--nobest").arg("-y").arg("update")
|
.arg(&dnf_bin).arg("--refresh").arg("--skip-broken").arg("--nobest").arg("-y").arg("update")
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
||||||
|
@ -98,9 +100,9 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// dnf5
|
// dnf5
|
||||||
cprintln!("<bold><rev><blue>Checking for dnf5</blue></rev></bold>");
|
|
||||||
let path = Path::new(&dnf5_bin);
|
let path = Path::new(&dnf5_bin);
|
||||||
if path.exists(){
|
if path.exists(){
|
||||||
|
cprintln!("<bold><rev>Updating via: dnf5</rev></bold>");
|
||||||
let mut cmd =
|
let mut cmd =
|
||||||
Command::new(&sudo_bin)
|
Command::new(&sudo_bin)
|
||||||
.arg(&dnf5_bin).arg("--refresh").arg("--skip-broken").arg("--nobest").arg("-y").arg("update")
|
.arg(&dnf5_bin).arg("--refresh").arg("--skip-broken").arg("--nobest").arg("-y").arg("update")
|
||||||
|
@ -110,99 +112,99 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// pacman
|
// pacman
|
||||||
cprintln!("<bold><rev><cyan>Checking for pacman</cyan></rev></bold>");
|
|
||||||
let path = Path::new(&pacman_bin);
|
let path = Path::new(&pacman_bin);
|
||||||
if path.exists(){
|
if path.exists(){
|
||||||
let mut cmd =
|
cprintln!("<bold><rev>Updating via: pacman</rev></bold>");
|
||||||
|
let mut cmd =
|
||||||
Command::new(&sudo_bin)
|
Command::new(&sudo_bin)
|
||||||
.arg(&pacman_bin).arg("-Syu")
|
.arg(&pacman_bin).arg("-Syu")
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
||||||
.spawn().unwrap();
|
.spawn().unwrap();
|
||||||
let _output = cmd.wait();
|
let _output = cmd.wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
// urpmi
|
// urpmi
|
||||||
cprintln!("<bold><rev><white>Checking for urpmi</white></rev></bold>");
|
|
||||||
let path = Path::new(&urpmi_bin);
|
let path = Path::new(&urpmi_bin);
|
||||||
if path.exists(){
|
if path.exists(){
|
||||||
let mut cmd =
|
cprintln!("<bold><rev>Updating via urpmi</rev></bold>");
|
||||||
|
let mut cmd =
|
||||||
Command::new(&sudo_bin)
|
Command::new(&sudo_bin)
|
||||||
.arg(&urpmi_bin).arg("--auto-update").arg("-y")
|
.arg(&urpmi_bin).arg("--auto-update").arg("-y")
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
||||||
.spawn().unwrap();
|
.spawn().unwrap();
|
||||||
let _output = cmd.wait();
|
let _output = cmd.wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
// zypper
|
// zypper
|
||||||
cprintln!("<bold><rev><green>Checking for zypper</green></rev></bold>");
|
|
||||||
let path = Path::new(&zypper_bin);
|
let path = Path::new(&zypper_bin);
|
||||||
if path.exists(){
|
if path.exists(){
|
||||||
let mut cmd =
|
cprintln!("<bold><rev>Updating via: zypper</rev></bold>");
|
||||||
|
let mut cmd =
|
||||||
Command::new(&sudo_bin)
|
Command::new(&sudo_bin)
|
||||||
.arg(&zypper_bin).arg("in").arg("-y")
|
.arg(&zypper_bin).arg("in").arg("-y")
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
||||||
.spawn().unwrap();
|
.spawn().unwrap();
|
||||||
let _output = cmd.wait();
|
let _output = cmd.wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check container formats
|
// Check container formats
|
||||||
cprintln!("<bold><rev><white>Checking application containers</white></rev></bold>");
|
cprintln!("<bold><rev>Checking application containers</rev></bold>");
|
||||||
|
|
||||||
|
|
||||||
// flatpak
|
// flatpak
|
||||||
cprintln!("<bold><rev><blue>Checking for user flatpak installs</blue></rev></bold>");
|
|
||||||
let path = Path::new(&flatpak_bin);
|
let path = Path::new(&flatpak_bin);
|
||||||
if path.exists(){
|
if path.exists(){
|
||||||
let mut cmd =
|
cprintln!("<bold><rev>Updating user flatpak installs</rev></bold>");
|
||||||
|
let mut cmd =
|
||||||
Command::new(&flatpak_bin)
|
Command::new(&flatpak_bin)
|
||||||
.arg("update").arg("--user").arg("-y")
|
.arg("update").arg("--user").arg("-y")
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
||||||
.spawn().unwrap();
|
.spawn().unwrap();
|
||||||
let _output = cmd.wait();
|
let _output = cmd.wait();
|
||||||
}
|
}
|
||||||
cprintln!("<bold><rev><blue>Checking for system flatpak installs</blue></rev></bold>");
|
|
||||||
let path = Path::new(&flatpak_bin);
|
let path = Path::new(&flatpak_bin);
|
||||||
if path.exists(){
|
if path.exists(){
|
||||||
let mut cmd =
|
cprintln!("<bold><rev>Updating system flatpak installs</rev></bold>");
|
||||||
|
let mut cmd =
|
||||||
Command::new(&sudo_bin)
|
Command::new(&sudo_bin)
|
||||||
.arg(&flatpak_bin).arg("update").arg("-y")
|
.arg(&flatpak_bin).arg("update").arg("-y")
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
||||||
.spawn().unwrap();
|
.spawn().unwrap();
|
||||||
let _output = cmd.wait();
|
let _output = cmd.wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
// snap
|
// snap
|
||||||
cprintln!("<bold><rev><magenta>Checking for user snap installation</magenta></rev></bold>");
|
|
||||||
let path = Path::new(&snap_bin);
|
let path = Path::new(&snap_bin);
|
||||||
if path.exists(){
|
if path.exists(){
|
||||||
let mut cmd =
|
cprintln!("<bold><rev>Updating user snap installation</rev></bold>");
|
||||||
|
let mut cmd =
|
||||||
Command::new(&snap_bin)
|
Command::new(&snap_bin)
|
||||||
.arg("refresh").arg("-y")
|
.arg("refresh").arg("-y")
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
||||||
.spawn().unwrap();
|
.spawn().unwrap();
|
||||||
let _output = cmd.wait();
|
let _output = cmd.wait();
|
||||||
}
|
}
|
||||||
cprintln!("<bold><rev><magenta>Checking for system snap installation</magenta></rev></bold>");
|
|
||||||
let path = Path::new(&snap_bin);
|
let path = Path::new(&snap_bin);
|
||||||
if path.exists(){
|
if path.exists(){
|
||||||
let mut cmd =
|
cprintln!("<bold><rev>Updating system snap installation</rev></bold>");
|
||||||
|
let mut cmd =
|
||||||
Command::new(&sudo_bin)
|
Command::new(&sudo_bin)
|
||||||
.arg(&snap_bin).arg("refresh").arg("-y")
|
.arg(&snap_bin).arg("refresh").arg("-y")
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
||||||
.spawn().unwrap();
|
.spawn().unwrap();
|
||||||
let _output = cmd.wait();
|
let _output = cmd.wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Python
|
//Python
|
||||||
cprintln!("<bold><rev><red>Updating Python user installation via pip-review</red></rev></bold>");
|
|
||||||
let path = Path::new(&pip_review_bin);
|
let path = Path::new(&pip_review_bin);
|
||||||
if path.exists(){
|
if path.exists(){
|
||||||
let mut cmd =
|
cprintln!("<bold><rev>Updating Python user installation via pip-review</rev></bold>");
|
||||||
|
let mut cmd =
|
||||||
Command::new(&pip_review_bin)
|
Command::new(&pip_review_bin)
|
||||||
.arg("--auto").arg("--local").arg("--user")
|
.arg("--auto").arg("--local").arg("--user")
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
||||||
.spawn().unwrap();
|
.spawn().unwrap();
|
||||||
let _output = cmd.wait();
|
let _output = cmd.wait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,191 +0,0 @@
|
||||||
use std::process::{Command, Stdio};
|
|
||||||
use std::path::Path;
|
|
||||||
use color_print::cprintln;
|
|
||||||
|
|
||||||
fn trim_newline(s: &mut String) {
|
|
||||||
if s.ends_with('\n') {
|
|
||||||
s.pop();
|
|
||||||
if s.ends_with('\r') {
|
|
||||||
s.pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
{
|
|
||||||
// Tell user that we are going to start the update procedure
|
|
||||||
cprintln!("<bold><rev><white>osupdater : rust edition</white></rev></bold>\n");
|
|
||||||
cprintln!("<bold><rev><white>This tool will locate any package managers on your system and run the update tool appropriate to it.</white></rev></bold>\n");
|
|
||||||
cprintln!("<bold><rev><white>Looking for native package managers.</white></rev></bold>\n");
|
|
||||||
let find_sudo = Command::new("which")
|
|
||||||
.arg("sudo").stdout(Stdio::piped()).output().unwrap();
|
|
||||||
let mut sudo_bin = String::from_utf8(find_sudo.stdout).unwrap();
|
|
||||||
trim_newline(&mut sudo_bin);
|
|
||||||
|
|
||||||
let find_apt = Command::new("which")
|
|
||||||
.arg("apt").stdout(Stdio::piped()).output().unwrap();
|
|
||||||
let mut apt_bin = String::from_utf8(find_apt.stdout).unwrap();
|
|
||||||
trim_newline(&mut apt_bin);
|
|
||||||
|
|
||||||
let find_dnf = Command::new("which")
|
|
||||||
.arg("dnf").stdout(Stdio::piped()).output().unwrap();
|
|
||||||
let mut dnf_bin = String::from_utf8(find_dnf.stdout).unwrap();
|
|
||||||
trim_newline(&mut dnf_bin);
|
|
||||||
|
|
||||||
let find_pacman = Command::new("which")
|
|
||||||
.arg("pacman").stdout(Stdio::piped()).output().unwrap();
|
|
||||||
let mut pacman_bin = String::from_utf8(find_pacman.stdout).unwrap();
|
|
||||||
trim_newline(&mut pacman_bin);
|
|
||||||
|
|
||||||
let find_urpmi = Command::new("which")
|
|
||||||
.arg("urpmi").stdout(Stdio::piped()).output().unwrap();
|
|
||||||
let mut urpmi_bin = String::from_utf8(find_urpmi.stdout).unwrap();
|
|
||||||
trim_newline(&mut urpmi_bin);
|
|
||||||
|
|
||||||
let find_zypper = Command::new("which")
|
|
||||||
.arg("zypper").stdout(Stdio::piped()).output().unwrap();
|
|
||||||
let mut zypper_bin = String::from_utf8(find_zypper.stdout).unwrap();
|
|
||||||
trim_newline(&mut zypper_bin);
|
|
||||||
|
|
||||||
let find_flatpak = Command::new("which")
|
|
||||||
.arg("flatpak").stdout(Stdio::piped()).output().unwrap();
|
|
||||||
let mut flatpak_bin = String::from_utf8(find_flatpak.stdout).unwrap();
|
|
||||||
trim_newline(&mut flatpak_bin);
|
|
||||||
|
|
||||||
let find_snap = Command::new("which")
|
|
||||||
.arg("snap").stdout(Stdio::piped()).output().unwrap();
|
|
||||||
let mut snap_bin = String::from_utf8(find_snap.stdout).unwrap();
|
|
||||||
trim_newline(&mut snap_bin);
|
|
||||||
|
|
||||||
let find_pip_review = Command::new("which")
|
|
||||||
.arg("pip-review").stdout(Stdio::piped()).output().unwrap();
|
|
||||||
let mut pip_review_bin = String::from_utf8(find_pip_review.stdout).unwrap();
|
|
||||||
trim_newline(&mut pip_review_bin);
|
|
||||||
|
|
||||||
//apt
|
|
||||||
cprintln!("<bold><rev><magenta>Checking for apt</magenta></rev></bold>");
|
|
||||||
let path = Path::new(&apt_bin);
|
|
||||||
if path.exists(){
|
|
||||||
let mut cmd =
|
|
||||||
Command::new(&sudo_bin)
|
|
||||||
.arg(&apt_bin).arg("update").arg("-y")
|
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
|
||||||
.spawn().unwrap();
|
|
||||||
let _output = cmd.wait();
|
|
||||||
let mut cmd =
|
|
||||||
Command::new(&sudo_bin)
|
|
||||||
.arg(&apt_bin).arg("upgrade").arg("-y")
|
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
|
||||||
.spawn().unwrap();
|
|
||||||
let _output = cmd.wait();
|
|
||||||
}
|
|
||||||
|
|
||||||
// dnf
|
|
||||||
cprintln!("<bold><rev><blue>hecking for dnf</blue></rev></bold>");
|
|
||||||
let path = Path::new(&dnf_bin);
|
|
||||||
if path.exists(){
|
|
||||||
let mut cmd =
|
|
||||||
Command::new(&sudo_bin)
|
|
||||||
.arg(&dnf_bin).arg("--refresh").arg("--skip-broken").arg("--nobest").arg("-y").arg("update")
|
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
|
||||||
.spawn().unwrap();
|
|
||||||
let _output = cmd.wait();
|
|
||||||
}
|
|
||||||
|
|
||||||
// pacman
|
|
||||||
cprintln!("<bold><rev><cyan>Checking for pacman</cyan></rev></bold>");
|
|
||||||
let path = Path::new(&pacman_bin);
|
|
||||||
if path.exists(){
|
|
||||||
let mut cmd =
|
|
||||||
Command::new(&sudo_bin)
|
|
||||||
.arg(&pacman_bin).arg("-Syu")
|
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
|
||||||
.spawn().unwrap();
|
|
||||||
let _output = cmd.wait();
|
|
||||||
}
|
|
||||||
|
|
||||||
// urpmi
|
|
||||||
cprintln!("<bold><rev><white>Checking for urpmi</white></rev></bold>");
|
|
||||||
let path = Path::new(&urpmi_bin);
|
|
||||||
if path.exists(){
|
|
||||||
let mut cmd =
|
|
||||||
Command::new(&sudo_bin)
|
|
||||||
.arg(&urpmi_bin).arg("--auto-update").arg("-y")
|
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
|
||||||
.spawn().unwrap();
|
|
||||||
let _output = cmd.wait();
|
|
||||||
}
|
|
||||||
|
|
||||||
// zypper
|
|
||||||
cprintln!("<bold><rev><green>Checking for zypper</green></rev></bold>");
|
|
||||||
let path = Path::new(&zypper_bin);
|
|
||||||
if path.exists(){
|
|
||||||
let mut cmd =
|
|
||||||
Command::new(&sudo_bin)
|
|
||||||
.arg(&zypper_bin).arg("in").arg("-y")
|
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
|
||||||
.spawn().unwrap();
|
|
||||||
let _output = cmd.wait();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check container formats
|
|
||||||
cprintln!("<bold><rev><white>Checking application containers</white></rev></bold>");
|
|
||||||
|
|
||||||
|
|
||||||
// flatpak
|
|
||||||
cprintln!("<bold><rev><blue>Checking for user flatpak installs</blue></rev></bold>");
|
|
||||||
let path = Path::new(&flatpak_bin);
|
|
||||||
if path.exists(){
|
|
||||||
let mut cmd =
|
|
||||||
Command::new(&flatpak_bin)
|
|
||||||
.arg("update").arg("--user").arg("-y")
|
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
|
||||||
.spawn().unwrap();
|
|
||||||
let _output = cmd.wait();
|
|
||||||
}
|
|
||||||
cprintln!("<bold><rev><blue>Checking for system flatpak installs</blue></rev></bold>");
|
|
||||||
let path = Path::new(&flatpak_bin);
|
|
||||||
if path.exists(){
|
|
||||||
let mut cmd =
|
|
||||||
Command::new(&sudo_bin)
|
|
||||||
.arg(&flatpak_bin).arg("update").arg("-y")
|
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
|
||||||
.spawn().unwrap();
|
|
||||||
let _output = cmd.wait();
|
|
||||||
}
|
|
||||||
|
|
||||||
// snap
|
|
||||||
cprintln!("<bold><rev><magenta>Checking for user snap installation</magenta></rev></bold>");
|
|
||||||
let path = Path::new(&snap_bin);
|
|
||||||
if path.exists(){
|
|
||||||
let mut cmd =
|
|
||||||
Command::new(&snap_bin)
|
|
||||||
.arg("refresh").arg("-y")
|
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
|
||||||
.spawn().unwrap();
|
|
||||||
let _output = cmd.wait();
|
|
||||||
}
|
|
||||||
cprintln!("<bold><rev><magenta>Checking for system snap installation</magenta></rev></bold>");
|
|
||||||
let path = Path::new(&snap_bin);
|
|
||||||
if path.exists(){
|
|
||||||
let mut cmd =
|
|
||||||
Command::new(&sudo_bin)
|
|
||||||
.arg(&snap_bin).arg("refresh").arg("-y")
|
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
|
||||||
.spawn().unwrap();
|
|
||||||
let _output = cmd.wait();
|
|
||||||
}
|
|
||||||
|
|
||||||
//Python
|
|
||||||
cprintln!("<bold><rev><red>Updating Python user installation via pip-review</red></rev></bold>");
|
|
||||||
let path = Path::new(&pip_review_bin);
|
|
||||||
if path.exists(){
|
|
||||||
let mut cmd =
|
|
||||||
Command::new(&pip_review_bin)
|
|
||||||
.arg("--auto").arg("--local").arg("--user")
|
|
||||||
.stdout(Stdio::inherit()).stderr(Stdio::inherit())
|
|
||||||
.spawn().unwrap();
|
|
||||||
let _output = cmd.wait();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue