[Frugalware-darcs] pacman: bugfix for -Se

VMiklos vmiklos at frugalware.org
Thu Mar 16 17:50:11 CET 2006


[bugfix for -Se
VMiklos <vmiklos at frugalware.org>**20060311015054
 closes #430
] {
hunk ./lib/libalpm/sync.c 392
-/* Helper function for _alpm_list_remove
+/* Helper functions for _alpm_list_remove
hunk ./lib/libalpm/sync.c 399
+static int pkg_cmp(const void *p1, const void *p2)
+{
+	return(strcmp(((pmpkg_t *)p1)->name, ((pmsyncpkg_t *)p2)->pkg->name));
+}
+
hunk ./lib/libalpm/sync.c 436
+
hunk ./lib/libalpm/sync.c 448
-			}
-		}
-
-		/* remove original targets from final if requested */
-		if((trans->flags & PM_TRANS_FLAG_DEPENDSONLY)) {
-			k = NULL;
-			for(i = trans->packages; i; i = i->next)
-			{
-				pmsyncpkg_t *s = (pmsyncpkg_t*)i->data;
-				int keepit = 1;
-				for(j = list; j; j = j->next)
-				{
-					if(!strcmp(j->data, s->pkg->name))
-					{
-						FREE(i->data);
-						keepit = 0;
-					}
-					if(keepit)
-						k = _alpm_list_add(k, s);
-					i->data = NULL;
+			} else {
+				/* remove the original targets from the list if requested */
+				if((trans->flags & PM_TRANS_FLAG_DEPENDSONLY)) {
+					pmpkg_t *p;
+					trans->packages = _alpm_list_remove(trans->packages, spkg, pkg_cmp, (void**)&p);
+					FREEPKG(p);
hunk ./lib/libalpm/sync.c 456
-			FREELIST(trans->packages);
-			trans->packages = k;
}


More information about the Frugalware-darcs mailing list