lib/transaction_pkg_deps.c: don't ignore unsatisfied held dependencies

This commit is contained in:
Duncan Overbruck 2021-03-19 13:52:37 +01:00
parent 5eeff164bf
commit d18e7f904a
No known key found for this signature in database
GPG Key ID: 335C1D17EC3D6E35

View File

@ -255,6 +255,7 @@ repo_deps(struct xbps_handle *xhp,
if (xbps_dictionary_get(curpkgd, "hold")) { if (xbps_dictionary_get(curpkgd, "hold")) {
ttype = XBPS_TRANS_HOLD; ttype = XBPS_TRANS_HOLD;
xbps_dbg_printf_append(xhp, " on hold state! ignoring package.\n"); xbps_dbg_printf_append(xhp, " on hold state! ignoring package.\n");
rv = ENODEV;
} else { } else {
xbps_dbg_printf_append(xhp, "\n"); xbps_dbg_printf_append(xhp, "\n");
ttype = XBPS_TRANS_INSTALL; ttype = XBPS_TRANS_INSTALL;
@ -264,11 +265,29 @@ repo_deps(struct xbps_handle *xhp,
if (xbps_dictionary_get(curpkgd, "hold")) { if (xbps_dictionary_get(curpkgd, "hold")) {
xbps_dbg_printf_append(xhp, " on hold state! ignoring package.\n"); xbps_dbg_printf_append(xhp, " on hold state! ignoring package.\n");
ttype = XBPS_TRANS_HOLD; ttype = XBPS_TRANS_HOLD;
rv = ENODEV;
} else { } else {
xbps_dbg_printf_append(xhp, "\n"); xbps_dbg_printf_append(xhp, "\n");
ttype = XBPS_TRANS_UPDATE; ttype = XBPS_TRANS_UPDATE;
} }
} }
/*
* Not satisfied and package on hold.
*/
if (rv == ENODEV) {
rv = add_missing_reqdep(xhp, reqpkg);
if (rv != 0 && rv != EEXIST) {
xbps_dbg_printf(xhp, "`%s': add_missing_reqdep failed\n", reqpkg);
break;
} else if (rv == EEXIST) {
xbps_dbg_printf(xhp, "`%s' missing dep already added.\n", reqpkg);
rv = 0;
continue;
} else {
xbps_dbg_printf(xhp, "`%s' added into the missing deps array.\n", reqpkg);
continue;
}
}
} else if (rv == 1) { } else if (rv == 1) {
/* /*
* The version requirement is satisfied. * The version requirement is satisfied.
@ -295,14 +314,6 @@ repo_deps(struct xbps_handle *xhp,
break; break;
} }
} }
if (xbps_dictionary_get(curpkgd, "hold")) {
if (!xbps_transaction_pkg_type_set(curpkgd, XBPS_TRANS_HOLD)) {
rv = EINVAL;
break;
}
xbps_dbg_printf(xhp, "%s on hold state! ignoring package.\n", curpkg);
continue;
}
/* /*
* Pass 4: find required dependency in repository pool. * Pass 4: find required dependency in repository pool.
* If dependency does not match add pkg into the missing * If dependency does not match add pkg into the missing