summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/cache.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-02-22 05:42:59 +0100
committerAaron Griffin <aaron@archlinux.org>2007-02-22 05:42:59 +0100
commit871e123cf3fafe5aff734e2c5cf1ce89a203f719 (patch)
tree540028fd906e924bea504d4ff79d22eb43e5a43e /lib/libalpm/cache.c
parent3595201f5f3c1274786844c541ef82edba6984f8 (diff)
downloadpacman-871e123cf3fafe5aff734e2c5cf1ce89a203f719.tar.gz
pacman-871e123cf3fafe5aff734e2c5cf1ce89a203f719.tar.xz
* Cleaned up some debug output
* Fixed a segfault in the conflict checking code * Added an automatic failure in the case of -A/-U for a replacement of an existing package. This requires a large amount of work and is postponed for now. Example: If ncmpc is installed, pacman -U /path/to/ncmpc-svn.pkg.tar.gz will fail with and appropriate error message
Diffstat (limited to 'lib/libalpm/cache.c')
-rw-r--r--lib/libalpm/cache.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libalpm/cache.c b/lib/libalpm/cache.c
index 456c98bd..e3df2fd2 100644
--- a/lib/libalpm/cache.c
+++ b/lib/libalpm/cache.c
@@ -61,7 +61,7 @@ int _alpm_db_load_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel)
_alpm_db_rewind(db);
while((info = _alpm_db_scan(db, NULL, infolevel)) != NULL) {
- _alpm_log(PM_LOG_DEBUG, _("adding '%s' to package cache for db '%s'"), info->name, db->treename);
+ _alpm_log(PM_LOG_FUNCTION, _("adding '%s' to package cache for db '%s'"), info->name, db->treename);
info->origin = PKG_FROM_CACHE;
info->data = db;
/* add to the collection */
@@ -195,7 +195,13 @@ pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, char *target)
return(NULL);
}
- return(_alpm_pkg_isin(target, _alpm_db_get_pkgcache(db, INFRQ_NONE)));
+ alpm_list_t *pkgcache = _alpm_db_get_pkgcache(db, INFRQ_NONE);
+ if(!pkgcache) {
+ _alpm_log(PM_LOG_DEBUG, _("error: pkgcache is NULL for db '%s'"), db->treename);
+ return(NULL);
+ }
+
+ return(_alpm_pkg_isin(target, pkgcache));
}
/* Returns a new group cache from db.