Hopefully fixed #14

i18n
Michal S 2 years ago
parent ec1f3b433a
commit 66d672f4cc
No known key found for this signature in database
GPG Key ID: A6A1A4DCB22279B9

@ -8,7 +8,7 @@ use crate::internal::commands::ShellCommand;
use crate::internal::error::SilentUnwrap; use crate::internal::error::SilentUnwrap;
use crate::internal::exit_code::AppExitCode; use crate::internal::exit_code::AppExitCode;
use crate::internal::rpc::rpcinfo; use crate::internal::rpc::rpcinfo;
use crate::{crash, info, log, prompt, Options}; use crate::{crash, info, log, warn, prompt, Options};
pub fn aur_install(a: Vec<String>, options: Options) { pub fn aur_install(a: Vec<String>, options: Options) {
// Initialise variables // Initialise variables
@ -21,9 +21,10 @@ pub fn aur_install(a: Vec<String>, options: Options) {
log!("Installing from AUR: {:?}", &a); log!("Installing from AUR: {:?}", &a);
} }
info!("Installing packages {} from the AUR", a.join(", ")); info!("Installing packages {} from the AUR", a.join(", "));
let mut failed = vec![];
for package in a { for package in a {
// Query AUR for package info // Query AUR for package info
let rpcres = rpcinfo(package); let rpcres = rpcinfo(package);
@ -197,13 +198,10 @@ pub fn aur_install(a: Vec<String>, options: Options) {
.silent_unwrap(AppExitCode::MakePkgError); .silent_unwrap(AppExitCode::MakePkgError);
if !status.success() { if !status.success() {
// If build failed, crash // If build failed, push to failed vec
fs::remove_dir_all(format!("{}/{}", cachedir, pkg)).unwrap(); fs::remove_dir_all(format!("{}/{}", cachedir, pkg)).unwrap();
crash!( failed.push(pkg.clone());
AppExitCode::PacmanError, return;
"Error encountered while installing {}, aborting",
pkg,
);
} }
// Return to cachedir // Return to cachedir
@ -212,4 +210,12 @@ pub fn aur_install(a: Vec<String>, options: Options) {
// Remove package from cache // Remove package from cache
remove_dir_all(format!("{}/{}", cachedir, &pkg)).unwrap(); remove_dir_all(format!("{}/{}", cachedir, &pkg)).unwrap();
} }
// If any packages failed to build, warn user with failed packages
if !failed.is_empty() {
warn!(
"Failed to build packages {}",
failed.join(", ")
);
}
} }

Loading…
Cancel
Save