summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/cache.c')
-rw-r--r--lib/libalpm/cache.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/libalpm/cache.c b/lib/libalpm/cache.c
index 2c03f961..2a98d886 100644
--- a/lib/libalpm/cache.c
+++ b/lib/libalpm/cache.c
@@ -36,13 +36,6 @@
#include "db.h"
#include "cache.h"
-/* Helper function for comparing packages
- */
-static int pkg_cmp(const void *p1, const void *p2)
-{
- return(strcmp(((pmpkg_t *)p1)->name, ((pmpkg_t *)p2)->name));
-}
-
/* Returns a new package cache from db.
* It frees the cache if it already exists.
*/
@@ -66,7 +59,7 @@ int _alpm_db_load_pkgcache(pmdb_t *db)
info->origin = PKG_FROM_CACHE;
info->data = db;
/* add to the collective */
- db->pkgcache = _alpm_list_add_sorted(db->pkgcache, info, pkg_cmp);
+ db->pkgcache = _alpm_list_add_sorted(db->pkgcache, info, _alpm_pkg_cmp);
}
return(0);
@@ -114,7 +107,7 @@ int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg)
return(-1);
}
_alpm_log(PM_LOG_DEBUG, "adding entry '%s' in '%s' cache", newpkg->name, db->treename);
- db->pkgcache = _alpm_list_add_sorted(db->pkgcache, newpkg, pkg_cmp);
+ db->pkgcache = _alpm_list_add_sorted(db->pkgcache, newpkg, _alpm_pkg_cmp);
_alpm_db_free_grpcache(db);
@@ -129,7 +122,7 @@ int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg)
return(-1);
}
- db->pkgcache = _alpm_list_remove(db->pkgcache, pkg, pkg_cmp, (void **)&data);
+ db->pkgcache = _alpm_list_remove(db->pkgcache, pkg, _alpm_pkg_cmp, (void **)&data);
if(data == NULL) {
/* package not found */
return(-1);