Skip to content

Commit

Permalink
feat(-Au): only warn when an installed package can't be found on the AUR
Browse files Browse the repository at this point in the history
Previously this would halt Aura completely. Packages occasionally
disappear from the AUR, which then triggers this, and it's quite annoying.
  • Loading branch information
fosskers committed Jun 12, 2024
1 parent cb5d745 commit 865ebee
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions rust/aura-pm/src/command/aur.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::env::Env;
use crate::error::Nested;
use crate::localization::Localised;
use crate::utils::{Finished, PathStr, ResultVoid, NOTHING};
use crate::{aura, green, proceed};
use crate::{aura, green, proceed, yellow};
use aura_core::Apply;
use colored::{ColoredString, Colorize};
use from_variants::FromVariants;
Expand Down Expand Up @@ -502,8 +502,21 @@ pub(crate) fn upgrade<'a>(
let clones: HashSet<PathBuf> = foreigns
.par_iter()
.map(|p| p.name.as_ref())
.map(|p| {
aura_core::aur::clone_path_of_pkgbase(&env.aur.clones, p, &crate::fetch::fetch_json)
.filter_map(|p| {
let rpath = aura_core::aur::clone_path_of_pkgbase(
&env.aur.clones,
p,
&crate::fetch::fetch_json,
);

match rpath {
Ok(path) => Some(Ok(path)),
Err(aura_core::aur::Error::PackageDoesNotExist(p)) => {
yellow!(fll, "faur-unknown", pkg = p);
None
}
Err(e) => Some(Err(e)),
}
})
.collect::<Result<HashSet<_>, aura_core::aur::Error>>()?;
debug!("Unique clones: {}", clones.len());
Expand Down

0 comments on commit 865ebee

Please sign in to comment.