xbps_transaction_shlibs: better interaction with on hold pkgs.

pkgs that are on hold mode should be ignored while collecting
required shlibs (shlib-requires).

Fixes #215
This commit is contained in:
Juan RP 2020-01-25 10:17:37 +01:00
parent 26b7864973
commit c6e0af44e8

View File

@ -82,13 +82,23 @@ collect_shlibs(struct xbps_handle *xhp, xbps_array_t pkgs, bool req)
iter = xbps_array_iterator(pkgs);
assert(iter);
while ((obj = xbps_object_iterator_next(iter))) {
char *pkgname;
const char *trans = NULL;
char *pkgname = NULL;
if (!xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver))
continue;
pkgname = xbps_pkg_name(pkgver);
assert(pkgname);
/* ignore shlibs if pkg is on hold mode */
if (xbps_dictionary_get_cstring_nocopy(obj, "transaction", &trans)) {
if (!strcmp(trans, "hold")) {
free(pkgname);
continue;
}
}
xbps_dictionary_set(pd, pkgname, obj);
free(pkgname);
}