[pacman-dev] [patch] Re: bug in alpm/deps.c

Nagy Gabor ngaba at petra.hos.u-szeged.hu
Mon Feb 26 17:36:50 EST 2007


Hi!
Here is my patch.

--- deps.c.bak	2007-02-21 09:34:36.000000000 +0100
+++ deps.c	2007-02-26 23:21:47.000000000 +0100
@@ -236,32 +236,17 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *
  					continue;
  				}
  				_alpm_db_read(db, p, INFRQ_DEPENDS);
-				for(k = p->depends; k && !found; k = 
k->next) {
-					/* find the dependency info in 
p->depends */
-					_alpm_splitdep(k->data, &depend);
-					if(!strcmp(depend.name, 
oldpkg->name)) {
-						found = 1;
-					}
-				}
-				if(found == 0) {
-					/* look for packages that list 
depend.name as a "provide" */
-					alpm_list_t *provides = 
_alpm_db_whatprovides(db, depend.name);
-					if(provides == NULL) {
-						/* not found */
-						continue;
-					}
-					/* we found an installed package 
that provides depend.name */
-					FREELISTPTR(provides);
-				}
-				if(!_alpm_depcmp(tp, &depend)) {
-					_alpm_log(PM_LOG_DEBUG, 
_("checkdeps: found %s as required by %s"),
- 
depend.name, p->name);
-					miss = _alpm_depmiss_new(p->name, 
PM_DEP_TYPE_REQUIRED, depend.mod,
- 
depend.name, depend.version);
-					if(!_alpm_depmiss_isin(miss, 
baddeps)) {
-						baddeps = 
alpm_list_add(baddeps, miss);
-					} else {
-						FREE(miss);
+				for(k = p->depends; k; k = k->next) {
+					/* we won't break the old 
dependencies */
+					_alpm_splitdep(k->data, &depend);
+					if(_alpm_depcmp(oldpkg, &depend) 
&& !_alpm_depcmp(tp, &depend)) {
+						_alpm_log(PM_LOG_DEBUG, 
_("checkdeps: the updated '%s' wouldn't satisfy a dependency of '%s'"),
+ 
oldpkg->name, p->name);
+						miss = 
_alpm_depmiss_new(p->name, PM_DEP_TYPE_REQUIRED, depend.mod,
+ 
depend.name, depend.version);
+ 
if(!_alpm_depmiss_isin(miss, baddeps)) {
+							baddeps = 
alpm_list_add(baddeps, miss);
+						} else FREE(miss);
  					}
  				}
  			}






More information about the pacman-dev mailing list