summaryrefslogtreecommitdiff
path: root/lib/libalpm/deps.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-12-01 09:51:54 +0000
committerAaron Griffin <aaron@archlinux.org>2006-12-01 09:51:54 +0000
commit448805890080756ee28615bff2ae6fd2a4fa42b6 (patch)
tree6ec9d7a259fd4e829c6811fc400cd1ec0ab9c020 /lib/libalpm/deps.c
parent08dca1593f82dfa4b5f1199b5b1f4d7099719be9 (diff)
downloadpacman-448805890080756ee28615bff2ae6fd2a4fa42b6.tar.xz
* Fixed the bug where -R pkgA pkgB failed when pkgA depended on pkgB
Diffstat (limited to 'lib/libalpm/deps.c')
-rw-r--r--lib/libalpm/deps.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 7b870085..7b32b7d0 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -332,19 +332,30 @@ pmlist_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, unsigned char op, pmlist
found=0;
for(j = tp->requiredby; j; j = j->next) {
+ /* Search for 'reqname' in packages for removal */
char *reqname = j->data;
- if(!_alpm_list_is_strin(reqname, packages)) {
+ pmlist_t *x = NULL;
+ for(x = packages; x; x = x->next) {
+ pmpkg_t *xp = x->data;
+ if(strcmp(reqname, xp->name) == 0) {
+ found = 1;
+ break;
+ }
+ }
+ if(!found) {
/* check if a package in trans->packages provides this package */
for(k=trans->packages; !found && k; k=k->next) {
pmpkg_t *spkg = NULL;
- if(trans->type == PM_TRANS_TYPE_SYNC) {
- pmsyncpkg_t *sync = k->data;
- spkg = sync->pkg;
- } else {
- spkg = k->data;
- }
- if(spkg && _alpm_list_is_strin(tp->name, spkg->provides)) {
- found=1;
+ if(trans->type == PM_TRANS_TYPE_SYNC) {
+ pmsyncpkg_t *sync = k->data;
+ spkg = sync->pkg;
+ } else {
+ spkg = k->data;
+ }
+ if(spkg) {
+ if(_alpm_list_is_strin(tp->name, spkg->provides)) {
+ found = 1;
+ }
}
}
if(!found) {