@@ -1223,6 +1223,7 @@ fn do_install(
1223
1223
args. arg ( "noconfirm" ) ;
1224
1224
}
1225
1225
1226
+ debug ! ( "flushing install queue" ) ;
1226
1227
args. targets = install_queue. iter ( ) . map ( |s| s. as_str ( ) ) . collect ( ) ;
1227
1228
exec:: pacman ( config, & args) ?. success ( ) ?;
1228
1229
@@ -1374,6 +1375,52 @@ fn sign_pkg(config: &Config, paths: &[&str], delete_sig: bool) -> Result<()> {
1374
1375
Ok ( ( ) )
1375
1376
}
1376
1377
1378
+ fn deps_satisfied ( config : & Config , base : & Base ) -> Result < bool > {
1379
+ let db = config. new_alpm ( ) ?;
1380
+ let db = db. localdb ( ) . pkgs ( ) ;
1381
+ let res = base
1382
+ . pkgs
1383
+ . iter ( )
1384
+ . flat_map ( |pkg| {
1385
+ let check = if config. no_check {
1386
+ None
1387
+ } else {
1388
+ Some ( & pkg. pkg . check_depends )
1389
+ } ;
1390
+ pkg. pkg
1391
+ . depends
1392
+ . iter ( )
1393
+ . chain ( & pkg. pkg . make_depends )
1394
+ . chain ( check. into_iter ( ) . flatten ( ) )
1395
+ } )
1396
+ . all ( |dep| db. find_satisfier ( dep. as_str ( ) ) . is_some ( ) ) ;
1397
+
1398
+ Ok ( res)
1399
+ }
1400
+
1401
+ fn deps_satisfied_by_repo ( config : & Config , base : & Base ) -> Result < bool > {
1402
+ let db = config. new_alpm ( ) ?;
1403
+ let db = db. syncdbs ( ) ;
1404
+ let res = base
1405
+ . pkgs
1406
+ . iter ( )
1407
+ . flat_map ( |pkg| {
1408
+ let check = if config. no_check {
1409
+ None
1410
+ } else {
1411
+ Some ( & pkg. pkg . check_depends )
1412
+ } ;
1413
+ pkg. pkg
1414
+ . depends
1415
+ . iter ( )
1416
+ . chain ( & pkg. pkg . make_depends )
1417
+ . chain ( check. into_iter ( ) . flatten ( ) )
1418
+ } )
1419
+ . all ( |dep| db. find_satisfier ( dep. as_str ( ) ) . is_some ( ) ) ;
1420
+
1421
+ Ok ( res)
1422
+ }
1423
+
1377
1424
#[ allow( clippy:: too_many_arguments) ]
1378
1425
fn build_install_pkgbuild < ' a > (
1379
1426
config : & mut Config ,
@@ -1393,36 +1440,21 @@ fn build_install_pkgbuild<'a>(
1393
1440
let mut debug_paths = HashMap :: new ( ) ;
1394
1441
let dir = config. build_dir . join ( base. package_base ( ) ) ;
1395
1442
1396
- let mut satisfied = false ;
1397
- if !config. chroot && config. batch_install {
1398
- let db = config. new_alpm ( ) ?;
1399
- let db = db. localdb ( ) . pkgs ( ) ;
1400
- if base
1401
- . pkgs
1402
- . iter ( )
1403
- . flat_map ( |pkg| {
1404
- let check = if config. no_check {
1405
- None
1406
- } else {
1407
- Some ( & pkg. pkg . check_depends )
1408
- } ;
1409
- pkg. pkg
1410
- . depends
1411
- . iter ( )
1412
- . chain ( & pkg. pkg . make_depends )
1413
- . chain ( check. into_iter ( ) . flatten ( ) )
1414
- } )
1415
- . all ( |dep| db. find_satisfier ( dep. as_str ( ) ) . is_some ( ) )
1416
- {
1417
- satisfied = true
1418
- }
1419
- }
1420
-
1421
- if !config. chroot && !satisfied {
1443
+ if !config. chroot && config. batch_install && deps_satisfied ( config, base) ? {
1422
1444
do_install ( config, deps, exp, install_queue, * conflict, devel_info) ?;
1423
1445
* conflict = false ;
1424
1446
}
1425
1447
1448
+ let ok = if config. chroot {
1449
+ deps_satisfied_by_repo ( config, base) ?
1450
+ } else {
1451
+ deps_satisfied ( config, base) ?
1452
+ } ;
1453
+
1454
+ if !ok {
1455
+ bail ! ( tr!( "can't build {}, deps not satisfied" , base) ) ;
1456
+ }
1457
+
1426
1458
if config. chroot {
1427
1459
chroot
1428
1460
. build ( & dir, & [ "-cu" ] , & [ "-ofA" ] )
0 commit comments