From 0845d6cae3f96a2e2cd946147cf00a5eed0136de Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 11 Mar 2013 12:13:02 +0100 Subject: [PATCH] xbps_transaction_remove_pkg: handle correctly target pkg. --- lib/transaction_ops.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/transaction_ops.c b/lib/transaction_ops.c index 7785c582..2ad1e1e7 100644 --- a/lib/transaction_ops.c +++ b/lib/transaction_ops.c @@ -313,7 +313,18 @@ xbps_transaction_remove_pkg(struct xbps_handle *xhp, prop_array_add(unsorted, obj); xbps_dbg_printf(xhp, "%s: added into transaction (remove).\n", pkgver); } + reqby = xbps_pkgdb_get_pkg_revdeps(xhp, pkgver); + /* + * If target pkg is required by any installed pkg, the client must be aware + * of this to take appropiate action. + */ + if ((prop_object_type(reqby) == PROP_TYPE_ARRAY) && + (prop_array_count(reqby) > 0)) + rv = EEXIST; + prop_object_release(orphans); + return rv; + rmpkg: /* * Add pkg dictionary into the transaction unsorted queue.