From bcd80f2936e4f689a32b768d0c1935f114c769c0 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 11 Jun 2019 18:13:19 +0200 Subject: [PATCH] xbps_alternatives_register: update pkgdb alternatives dictionary. ... otherwise the entry might not be added to our array and won't hit pkgdb. Signed-off-by: Juan RP --- lib/package_alternatives.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/package_alternatives.c b/lib/package_alternatives.c index cb6ddee0..4971e6b0 100644 --- a/lib/package_alternatives.c +++ b/lib/package_alternatives.c @@ -470,14 +470,18 @@ xbps_alternatives_register(struct xbps_handle *xhp, xbps_dictionary_t pkg_repod) if (array == NULL) { array = xbps_array_create(); } else { - /* already registered */ if (xbps_match_string_in_array(array, pkgname)) { - /* apply alternatives for this group */ + /* already registered, update symlinks */ rv = create_symlinks(xhp, xbps_dictionary_get(pkg_alternatives, keyname), keyname); if (rv != 0) break; + } else { + /* not registered, add provider */ + xbps_array_add_cstring(array, pkgname); + xbps_set_cb_state(xhp, XBPS_STATE_ALTGROUP_ADDED, 0, NULL, + "%s: registered '%s' alternatives group", pkgver, keyname); } continue; }