From 732a0e6bdf6a59e761d72fda291d52038358fdfe Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 7 Feb 2020 09:43:47 +0100 Subject: [PATCH] alternatives: fixed replace_alternative_with_symlink test case. Only 1 expected failure now! --- lib/package_alternatives.c | 6 ++---- tests/xbps/xbps-alternatives/main_test.sh | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/package_alternatives.c b/lib/package_alternatives.c index ec794cdc..f3f9ccad 100644 --- a/lib/package_alternatives.c +++ b/lib/package_alternatives.c @@ -507,12 +507,10 @@ remove_obsoletes(struct xbps_handle *xhp, char *pkgname, const char *pkgver, * Check if current provider in pkgdb is this pkg. */ array2 = xbps_dictionary_get(pkgdb_alts, keyname); - if (array2 == NULL) { - remove_symlinks(xhp, array, keyname); - } else { + if (array2) { xbps_array_get_cstring_nocopy(array2, 0, &first); if (strcmp(pkgname, first) == 0) { - remove_symlinks(xhp, array, keyname); + remove_symlinks(xhp, array_repo, keyname); } } } diff --git a/tests/xbps/xbps-alternatives/main_test.sh b/tests/xbps/xbps-alternatives/main_test.sh index f31fe2af..da4a38cb 100644 --- a/tests/xbps/xbps-alternatives/main_test.sh +++ b/tests/xbps/xbps-alternatives/main_test.sh @@ -772,8 +772,6 @@ replace_alternative_with_symlink_head() { atf_set "descr" "xbps-alternatives: replace alternative group with a symlink" } replace_alternative_with_symlink_body() { - atf_expect_fail "not fixed yet" - mkdir -p repo pkg_A/usr/bin touch pkg_A/usr/bin/fileA cd repo