xbps_alternatives_register: fix test case "more_entries_update".

Even if the alternatives group is already registered, we need
to create the symlinks from current pkg dictionary (repo).

Signed-off-by: Juan RP <xtraeme@gmail.com>
This commit is contained in:
Juan RP 2019-06-11 16:34:25 +02:00 committed by Duncan Overbruck
parent d021698365
commit d189921818

View File

@ -472,8 +472,15 @@ xbps_alternatives_register(struct xbps_handle *xhp, xbps_dictionary_t pkg_repod)
array = xbps_array_create();
} else {
/* already registered */
if (xbps_match_string_in_array(array, pkgname))
continue;
if (xbps_match_string_in_array(array, pkgname)) {
/* apply alternatives for this group */
rv = create_symlinks(xhp,
xbps_dictionary_get(pkg_alternatives, keyname),
keyname);
if (rv != 0)
break;
}
continue;
}
xbps_array_add_cstring(array, pkgname);
@ -485,7 +492,8 @@ xbps_alternatives_register(struct xbps_handle *xhp, xbps_dictionary_t pkg_repod)
rv = create_symlinks(xhp,
xbps_dictionary_get(pkg_alternatives, keyname),
keyname);
xbps_object_release(array);
if (alloc)
xbps_object_release(array);
if (rv != 0)
break;
}