From b81dedb7708d01bb88e50580d4ec6e0969ad7609 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 25 Oct 2014 05:20:13 +0200 Subject: [PATCH] lib/transaction_package_replace.c: simplify. --- lib/transaction_package_replace.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/transaction_package_replace.c b/lib/transaction_package_replace.c index 3c0603be..f8e6ceca 100644 --- a/lib/transaction_package_replace.c +++ b/lib/transaction_package_replace.c @@ -85,20 +85,18 @@ xbps_transaction_package_replace(struct xbps_handle *xhp, xbps_array_t pkgs) /* * Make sure to not add duplicates. */ + xbps_dictionary_get_bool(instd, "automatic-install", &instd_auto); reppkgd = xbps_find_pkg_in_array(pkgs, curpkgname, NULL); if (reppkgd) { xbps_dictionary_get_cstring_nocopy(reppkgd, "transaction", &tract); if (strcmp(tract, "remove") == 0) continue; - } - /* - * Package contains replaces="pkgpattern", but the - * package that should be replaced is also in the - * transaction and it's going to be updated. - */ - xbps_dictionary_get_bool(instd, "automatic-install", &instd_auto); - if ((reppkgd = xbps_find_pkg_in_array(pkgs, curpkgname, NULL))) { + /* + * Package contains replaces="pkgpattern", but the + * package that should be replaced is also in the + * transaction and it's going to be updated. + */ xbps_dictionary_set_bool(reppkgd, "automatic-install", instd_auto); xbps_dictionary_set_bool(reppkgd,