i18n
jan Michal 2 years ago
parent 8b6fabad74
commit c5c65e2dee

@ -0,0 +1,9 @@
use crate::internal::strings::info;
pub fn detect(a: String) {
if a.contains(".pacnew") || a.contains(".new") {
info("It appears that a program you have installed / upgraded has installed a .new/.pacnew config file. Please read over the pacman output and act on it accordingly".to_string());
} else if a.contains(".old") {
info("It appears that a program you have installed / upgraded has installed a .old config file. Please read over the pacman output and act on it accordingly".to_string());
}
}

@ -1,5 +1,5 @@
use std::process::{exit, Command};
use std::{env, io};
use std::{env, io, process};
use clap::{App, AppSettings, Arg, ArgMatches, ArgSettings, Shell, SubCommand};
@ -174,6 +174,17 @@ fn main() {
sorted.nf.join(", ")
));
}
let out = process::Command::new("bash")
.args(&["-c", "sudo find /etc -name *.pacnew"])
.output()
.expect("Something has gone wrong")
.stdout;
if !String::from_utf8((*out).to_owned()).unwrap().is_empty() {
info(format!("You have .pacnew files in /etc ({}) that you haven't removed or acted upon, it is recommended you do that now", String::from_utf8((*out).to_owned()).unwrap().split_whitespace().collect::<Vec<&str>>().join(", ")));
}
exit(0);
}

@ -128,7 +128,7 @@ pub fn aur_install(a: Vec<String>, options: Options) {
crate::operations::aur_install(md_sorted.aur, newopts);
}
let mut makepkg_args = vec!["-rsic", "--needed", "--skippgp"];
let mut makepkg_args = vec!["-rsic", "--skippgp"];
if options.asdeps {
makepkg_args.push("--asdeps")
}

@ -10,29 +10,31 @@ pub fn install(a: Vec<String>, options: Options) {
opers.push("--asdeps".to_string());
}
let verbosity = options.verbosity;
if verbosity >= 1 {
log(format!("Installing from repos: {:?}", &a));
}
if !a.is_empty() {
if verbosity >= 1 {
log(format!("Installing from repos: {:?}", &a));
}
let r = runas::Command::new("pacman")
.arg("-S")
.arg("--needed")
.args(&a)
.args(&opers)
.status()
.expect("Something has gone wrong");
let r = runas::Command::new("pacman")
.arg("-S")
.arg("--needed")
.args(&a)
.args(&opers)
.status()
.expect("Something has gone wrong");
if r.code() != Some(0) {
crash(
format!(
"An error occured while installing packages: {}, aborting",
a.join(", ")
),
7,
);
}
if r.code() != Some(0) {
crash(
format!(
"An error occured while installing packages: {}, aborting",
a.join(", ")
),
7,
);
}
if verbosity >= 1 {
log(format!("Installing packages: {:?} was successful", &a));
if verbosity >= 1 {
log(format!("Installing packages: {:?} was successful", &a));
}
}
}

Loading…
Cancel
Save