[pacman-dev] [PATCH] Incorrect usage of alpm_db_whatprovides in sync.c

Nagy Gabor ngaba at bibl.u-szeged.hu
Sat Nov 10 12:20:51 EST 2007


From 82e113f07a8d70e8cc0a1cbd2b1743981494d333 Mon Sep 17 00:00:00 2001
From: Nagy Gabor <ngaba at bibl.u-szeged.hu>
Date: Sat, 10 Nov 2007 18:11:40 +0100
Subject: [PATCH] Incorrect usage of alpm_db_whatprovides in sync.c
 The old code thought that alpm_db_whatprovides returns with a list of strings (package names).
 Signed-off-by: Nagy Gabor <ngaba at bibl.u-szeged.hu>

---
 lib/libalpm/sync.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 7791e74..e696b58 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -280,9 +280,9 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy
 					if(!p) {
 						RET_ERR(PM_ERR_PKG_NOT_FOUND, -1);
 					}
+					spkg = (pmpkg_t *) p->data;
 					_alpm_log(PM_LOG_DEBUG, "found '%s' as a provision for '%s'\n",
-							(char *)p->data, targ);
-					spkg = _alpm_db_get_pkgfromcache(db, p->data);
+							alpm_pkg_get_name(spkg), targ);
 					alpm_list_free(p);
 				}
 			}
@@ -304,9 +304,9 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy
 				pmdb_t *db = j->data;
 				alpm_list_t *p = _alpm_db_whatprovides(db, targ);
 				if(p) {
+					spkg = (pmpkg_t *) p->data;
 					_alpm_log(PM_LOG_DEBUG, "found '%s' as a provision for '%s' in db '%s'\n",
-							(char *)p->data, targ, db->treename);
-					spkg = _alpm_db_get_pkgfromcache(db, p->data);
+							alpm_pkg_get_name(spkg), targ, db->treename);
 					alpm_list_free(p);
 				}
 			}
-- 
1.5.3.4





More information about the pacman-dev mailing list