[pacman-dev] [PATCH] Fix for remove052.py by moving recursedeps before checkdeps

Nagy Gabor ngaba at bibl.u-szeged.hu
Sat Apr 19 16:35:53 EDT 2008


From 606d2a931da6f2d942cfc15ddc9400ecc4596a7b Mon Sep 17 00:00:00 2001
From: Nagy Gabor <ngaba at bibl.u-szeged.hu>
Date: Sat, 19 Apr 2008 22:31:22 +0200
Subject: [PATCH] Fix for remove052.py by moving recursedeps before checkdeps

Now -Rs is processed in the plausible way: first pull the dependencies then call checkdeps.
Note: -Rs is a little bit slower now, because we shouldn't check the pulled deps

In case of -Rcs we keep the old behavior because the bug cannot happen there
and we must pull the pulled targets' deps too.

Ref.: http://www.archlinux.org/pipermail/pacman-dev/2008-April/011569.html

Signed-off-by: Nagy Gabor <ngaba at bibl.u-szeged.hu>
---
 lib/libalpm/remove.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index dfdcabe..556d175 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -96,6 +96,11 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
 		return(0);
 	}
 
+	if((trans->flags & PM_TRANS_FLAG_RECURSE) && !(trans->flags & PM_TRANS_FLAG_CASCADE)) {
+		_alpm_log(PM_LOG_DEBUG, "finding removable dependencies\n");
+		_alpm_recursedeps(db, trans->packages, trans->flags & PM_TRANS_FLAG_RECURSEALL);
+	}
+
 	if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) {
 		EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL);
 
@@ -163,7 +168,8 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
 	alpm_list_free(trans->packages);
 	trans->packages = lp;
 
-	if(trans->flags & PM_TRANS_FLAG_RECURSE) {
+	/* -Rcs == -Rc then -Rs */
+	if((trans->flags & PM_TRANS_FLAG_CASCADE) && (trans->flags & PM_TRANS_FLAG_RECURSE)) {
 		_alpm_log(PM_LOG_DEBUG, "finding removable dependencies\n");
 		_alpm_recursedeps(db, trans->packages, trans->flags & PM_TRANS_FLAG_RECURSEALL);
 	}
-- 
1.5.3.8





More information about the pacman-dev mailing list