Skip to content

Commit

Permalink
Fix pkgbuild review
Browse files Browse the repository at this point in the history
  • Loading branch information
Morganamilo committed Nov 27, 2023
1 parent e9799e9 commit bf35cab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;

Expand Down Expand Up @@ -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(());
}
Expand Down
20 changes: 18 additions & 2 deletions src/pkgbuild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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)?;
Expand Down Expand Up @@ -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::<Vec<_>>();
review(config, &self.fetch, &review_repos)?;

let all_repos = repos.iter().map(|r| r.name.as_str()).collect::<Vec<_>>();
self.fetch.merge(&all_repos)?;

self.repos.iter().for_each(|r| r.generate_srcinfos(config));
Ok(())
}
Expand Down

0 comments on commit bf35cab

Please sign in to comment.