Skip to content

Commit

Permalink
Don't consider deps satisfied by own pkgbase missing
Browse files Browse the repository at this point in the history
Fixes the early missing dep check failing for split packages that depend
on eachother.

Fixes #794
  • Loading branch information
Morganamilo committed Jul 6, 2022
1 parent f468856 commit 8c24f92
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ use std::process::{Command, Stdio};
use std::sync::atomic::Ordering;

use alpm::{Alpm, Depend, Version};
use alpm_utils::depends::{satisfies_dep, satisfies_provide, satisfies_provide_nover};
use alpm_utils::depends::{
satisfies, satisfies_dep, satisfies_nover, satisfies_provide, satisfies_provide_nover,
};
use alpm_utils::{DbListExt, Targ};
use ansi_term::Style;
use anyhow::{bail, ensure, Context, Result};
Expand Down Expand Up @@ -1444,14 +1446,37 @@ fn build_install_pkgbuild<'a>(
*conflict = false;
}

let missing = if config.args.count("d", "nodeps") > 1 {
let mut missing = if config.args.count("d", "nodeps") > 1 {
Vec::new()
} else if config.chroot {
deps_not_satisfied_by_repo(config, base)?
} else {
deps_not_satisfied(config, base)?
};

if config.args.count("d", "nodeps") > 0 {
for pkg in &base.pkgs {
missing.retain(|mis| {
!satisfies_nover(
Depend::new(mis.as_str()),
&pkg.pkg.name,
pkg.pkg.provides.iter().map(|p| Depend::new(p.as_str())),
)
})
}
} else {
for pkg in &base.pkgs {
missing.retain(|mis| {
!satisfies(
Depend::new(mis.as_str()),
&pkg.pkg.name,
Version::new(pkg.pkg.version.as_str()),
pkg.pkg.provides.iter().map(|p| Depend::new(p.as_str())),
)
})
}
}

if !missing.is_empty() {
bail!(tr!(
"can't build {base}, deps not satisfied: {deps}",
Expand Down

0 comments on commit 8c24f92

Please sign in to comment.