diff --git a/src/install.rs b/src/install.rs index e83d4178..48805105 100644 --- a/src/install.rs +++ b/src/install.rs @@ -1578,8 +1578,6 @@ fn print_dir( let c = config.color; let has_pkgbuild = path.join("PKGBUILD").exists(); - println!("{:?} {:?}", path, has_pkgbuild); - for file in read_dir(path).with_context(|| tr!("failed to read dir: {}", path.display()))? { let file = file?; @@ -1655,7 +1653,7 @@ fn print_dir( Ok(()) } -fn review(config: &Config, fetch: &aur_fetch::Fetch, pkgs: &[&str]) -> Result<()> { +pub fn review(config: &Config, fetch: &aur_fetch::Fetch, pkgs: &[&str]) -> Result<()> { if pkgs.is_empty() { return Ok(()); } diff --git a/src/pkgbuild.rs b/src/pkgbuild.rs index 1f1ac1be..cf6eb5de 100644 --- a/src/pkgbuild.rs +++ b/src/pkgbuild.rs @@ -7,7 +7,7 @@ use std::{ sync::Arc, }; -use crate::{download::print_download, exec}; +use crate::{download::print_download, exec, install::review}; use anyhow::{anyhow, bail, Context, Result}; use aur_fetch::Fetch; use indicatif::{ProgressBar, ProgressStyle}; @@ -215,7 +215,7 @@ impl PkgbuildRepo { return Ok(()); } - log::debug!("for each pkgbuild: {}", path.display()); + //log::debug!("for each pkgbuild: {}", path.display()); if path.join("PKGBUILD").exists() { f(path, data)?; @@ -362,6 +362,22 @@ impl PkgbuildRepos { pb.finish(); } + let review_repos = repos + .iter() + .filter(|r| { + !config + .pkgbuild_repos + .repo(&r.name) + .map(|r| r.skip_review) + .unwrap_or(false) + }) + .map(|r| r.name.as_str()) + .collect::>(); + review(config, &self.fetch, &review_repos)?; + + let all_repos = repos.iter().map(|r| r.name.as_str()).collect::>(); + self.fetch.merge(&all_repos)?; + self.repos.iter().for_each(|r| r.generate_srcinfos(config)); Ok(()) }