From 170d63190a3cfb0c12ee9ddfe07b21f20825bd6f Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 24 Jan 2007 08:51:50 +0000 Subject: * Shuffled some of the alpm_list free funtions - still not perfect, but better * Added alpm_list_remove_node for single list node removal * Proper error checking/output for failed db_read/db_write (missing files) * Invalid packages (missing files) are now removed from the package cache * -Qs and -Ss output now look the same * config.rpath causes errors on one machine I had, so I added it to CVS * Fixed a "clobbered memory" issue when installing groups - only the outer list should be free'd, not the contained data --- lib/libalpm/cache.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/cache.c') diff --git a/lib/libalpm/cache.c b/lib/libalpm/cache.c index d03cf203..81737d3c 100644 --- a/lib/libalpm/cache.c +++ b/lib/libalpm/cache.c @@ -112,8 +112,13 @@ int _alpm_db_ensure_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel) for(p = db->pkgcache; p; p = p->next) { pmpkg_t *pkg = (pmpkg_t *)p->data; if(infolevel != INFRQ_NONE && !(pkg->infolevel & infolevel)) { - _alpm_db_read(db, infolevel, pkg); - reloaded = 1; + if(_alpm_db_read(db, infolevel, pkg) == -1) { + _alpm_log(PM_LOG_ERROR, _("failed to read package '%s-%s', removing from package cache"), + pkg->name, pkg->version); + p = alpm_list_remove_node(p); + } else { + reloaded = 1; + } } } if(reloaded) { -- cgit v1.2.3-70-g09d2