From 0191525d7c340e024a59fbc6e40b4cc9c64786f4 Mon Sep 17 00:00:00 2001 From: Duncan Overbruck Date: Tue, 16 Mar 2021 01:02:26 +0100 Subject: [PATCH] lib: make only manual install mode sticky when replacing packages --- lib/transaction_check_replaces.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/transaction_check_replaces.c b/lib/transaction_check_replaces.c index 997b815e..cd468a51 100644 --- a/lib/transaction_check_replaces.c +++ b/lib/transaction_check_replaces.c @@ -125,12 +125,7 @@ xbps_transaction_check_replaces(struct xbps_handle *xhp, xbps_array_t pkgs) * package that should be replaced is also in the * transaction and it's going to be updated. */ - if (instd_auto) { - if (!xbps_dictionary_set_bool(obj, "automatic-install", instd_auto)) { - xbps_object_iterator_release(iter); - return false; - } - } else { + if (!instd_auto) { xbps_dictionary_remove(obj, "automatic-install"); } if (!xbps_dictionary_set_bool(reppkgd, "replaced", true)) { @@ -157,9 +152,8 @@ xbps_transaction_check_replaces(struct xbps_handle *xhp, xbps_array_t pkgs) * the automatic-install object. */ if (xbps_match_virtual_pkg_in_dict(obj, pattern)) { - if (!xbps_dictionary_set_bool(obj, "automatic-install", instd_auto)) { - xbps_object_iterator_release(iter); - return false; + if (!instd_auto) { + xbps_dictionary_remove(obj, "automatic-install"); } } /*