[pacman-dev] [PATCH 2/2] alpm: alpm_db_get_pkgcache_list => alpm_db_get_pkgcache
Dave Reisner
d at falconindy.com
Fri Feb 25 09:29:47 EST 2011
This avoids needless breakage of the public API.
Signed-off-by: Dave Reisner <d at falconindy.com>
---
lib/libalpm/alpm.h | 2 +-
lib/libalpm/conflict.c | 2 +-
lib/libalpm/db.c | 12 ++++++------
lib/libalpm/db.h | 2 +-
lib/libalpm/deps.c | 6 +++---
lib/libalpm/package.c | 2 +-
lib/libalpm/remove.c | 6 +++---
lib/libalpm/sync.c | 8 ++++----
src/pacman/deptest.c | 2 +-
src/pacman/query.c | 6 +++---
src/pacman/sync.c | 10 +++++-----
src/util/cleanupdelta.c | 2 +-
src/util/pactree.c | 4 ++--
src/util/testdb.c | 4 ++--
14 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 03d129a..19ea4ff 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -186,7 +186,7 @@ int alpm_db_setserver(pmdb_t *db, const char *url);
int alpm_db_update(int level, pmdb_t *db);
pmpkg_t *alpm_db_get_pkg(pmdb_t *db, const char *name);
-alpm_list_t *alpm_db_get_pkgcache_list(pmdb_t *db);
+alpm_list_t *alpm_db_get_pkgcache(pmdb_t *db);
pmgrp_t *alpm_db_readgrp(pmdb_t *db, const char *name);
alpm_list_t *alpm_db_get_grpcache(pmdb_t *db);
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index 8fda7a7..6faced1 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -190,7 +190,7 @@ alpm_list_t *_alpm_outerconflicts(pmdb_t *db, alpm_list_t *packages)
return(NULL);
}
- alpm_list_t *dblist = alpm_list_diff(_alpm_db_get_pkgcache_list(db),
+ alpm_list_t *dblist = alpm_list_diff(_alpm_db_get_pkgcache(db),
packages, _alpm_pkg_cmp);
/* two checks to be done here for conflicts */
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index bf65406..2a8db8e 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -251,7 +251,7 @@ pmpkg_t SYMEXPORT *alpm_db_get_pkg(pmdb_t *db, const char *name)
* @param db pointer to the package database to get the package from
* @return the list of packages on success, NULL on error
*/
-alpm_list_t SYMEXPORT *alpm_db_get_pkgcache_list(pmdb_t *db)
+alpm_list_t SYMEXPORT *alpm_db_get_pkgcache(pmdb_t *db)
{
ALPM_LOG_FUNC;
@@ -259,7 +259,7 @@ alpm_list_t SYMEXPORT *alpm_db_get_pkgcache_list(pmdb_t *db)
ASSERT(handle != NULL, return(NULL));
ASSERT(db != NULL, return(NULL));
- return(_alpm_db_get_pkgcache_list(db));
+ return(_alpm_db_get_pkgcache(db));
}
/** Get a group entry from a package database
@@ -417,7 +417,7 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles)
const alpm_list_t *i, *j, *k;
alpm_list_t *ret = NULL;
/* copy the pkgcache- we will free the list var after each needle */
- alpm_list_t *list = alpm_list_copy(_alpm_db_get_pkgcache_list(db));
+ alpm_list_t *list = alpm_list_copy(_alpm_db_get_pkgcache(db));
ALPM_LOG_FUNC;
@@ -523,7 +523,7 @@ void _alpm_db_free_pkgcache(pmdb_t *db)
_alpm_log(PM_LOG_DEBUG, "freeing package cache for repository '%s'\n",
db->treename);
- alpm_list_free_inner(_alpm_db_get_pkgcache_list(db),
+ alpm_list_free_inner(_alpm_db_get_pkgcache(db),
(alpm_list_fn_free)_alpm_pkg_free);
_alpm_pkghash_free(db->pkgcache);
db->pkgcache_loaded = 0;
@@ -551,7 +551,7 @@ pmpkghash_t *_alpm_db_get_pkgcache_hash(pmdb_t *db)
return(db->pkgcache);
}
-alpm_list_t *_alpm_db_get_pkgcache_list(pmdb_t *db)
+alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db)
{
ALPM_LOG_FUNC;
@@ -650,7 +650,7 @@ int _alpm_db_load_grpcache(pmdb_t *db)
_alpm_log(PM_LOG_DEBUG, "loading group cache for repository '%s'\n",
db->treename);
- for(lp = _alpm_db_get_pkgcache_list(db); lp; lp = lp->next) {
+ for(lp = _alpm_db_get_pkgcache(db); lp; lp = lp->next) {
const alpm_list_t *i;
pmpkg_t *pkg = lp->data;
diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h
index 02a91f1..a530a2e 100644
--- a/lib/libalpm/db.h
+++ b/lib/libalpm/db.h
@@ -87,7 +87,7 @@ void _alpm_db_free_pkgcache(pmdb_t *db);
int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg);
int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg);
pmpkghash_t *_alpm_db_get_pkgcache_hash(pmdb_t *db);
-alpm_list_t *_alpm_db_get_pkgcache_list(pmdb_t *db);
+alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db);
int _alpm_db_ensure_pkgcache(pmdb_t *db, pmdbinfrq_t infolevel);
pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, const char *target);
/* groups */
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 5c60864..7625fa1 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -475,7 +475,7 @@ static int can_remove_package(pmdb_t *db, pmpkg_t *pkg, alpm_list_t *targets,
* if checkdeps detected it would break something */
/* see if other packages need it */
- for(i = _alpm_db_get_pkgcache_list(db); i; i = i->next) {
+ for(i = _alpm_db_get_pkgcache(db); i; i = i->next) {
pmpkg_t *lpkg = i->data;
if(_alpm_dep_edge(lpkg, pkg) && !_alpm_pkg_find(targets, lpkg->name)) {
return(0);
@@ -508,7 +508,7 @@ void _alpm_recursedeps(pmdb_t *db, alpm_list_t *targs, int include_explicit)
for(i = targs; i; i = i->next) {
pmpkg_t *pkg = i->data;
- for(j = _alpm_db_get_pkgcache_list(db); j; j = j->next) {
+ for(j = _alpm_db_get_pkgcache(db); j; j = j->next) {
pmpkg_t *deppkg = j->data;
if(_alpm_dep_edge(pkg, deppkg)
&& can_remove_package(db, deppkg, targs, include_explicit)) {
@@ -586,7 +586,7 @@ pmpkg_t *_alpm_resolvedep(pmdepend_t *dep, alpm_list_t *dbs,
}
/* 2. satisfiers (skip literals here) */
for(i = dbs; i; i = i->next) {
- for(j = _alpm_db_get_pkgcache_list(i->data); j; j = j->next) {
+ for(j = _alpm_db_get_pkgcache(i->data); j; j = j->next) {
pmpkg_t *pkg = j->data;
if(_alpm_depcmp_tolerant(pkg, dep) && strcmp(pkg->name, dep->name) != 0 &&
!_alpm_pkg_find(excluding, pkg->name)) {
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index 0a1102c..d4b3b9c 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -338,7 +338,7 @@ int SYMEXPORT alpm_pkg_has_scriptlet(pmpkg_t *pkg)
static void find_requiredby(pmpkg_t *pkg, pmdb_t *db, alpm_list_t **reqs)
{
const alpm_list_t *i;
- for(i = _alpm_db_get_pkgcache_list(db); i; i = i->next) {
+ for(i = _alpm_db_get_pkgcache(db); i; i = i->next) {
if(!i->data) {
continue;
}
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 823795b..5def92a 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -95,7 +95,7 @@ static void remove_prepare_cascade(pmtrans_t *trans, pmdb_t *db,
}
alpm_list_free_inner(lp, (alpm_list_fn_free)_alpm_depmiss_free);
alpm_list_free(lp);
- lp = alpm_checkdeps(_alpm_db_get_pkgcache_list(db), 1, trans->remove, NULL);
+ lp = alpm_checkdeps(_alpm_db_get_pkgcache(db), 1, trans->remove, NULL);
}
}
@@ -125,7 +125,7 @@ static void remove_prepare_keep_needed(pmtrans_t *trans, pmdb_t *db,
}
alpm_list_free_inner(lp, (alpm_list_fn_free)_alpm_depmiss_free);
alpm_list_free(lp);
- lp = alpm_checkdeps(_alpm_db_get_pkgcache_list(db), 1, trans->remove, NULL);
+ lp = alpm_checkdeps(_alpm_db_get_pkgcache(db), 1, trans->remove, NULL);
}
}
@@ -147,7 +147,7 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL);
_alpm_log(PM_LOG_DEBUG, "looking for unsatisfied dependencies\n");
- lp = alpm_checkdeps(_alpm_db_get_pkgcache_list(db), 1, trans->remove, NULL);
+ lp = alpm_checkdeps(_alpm_db_get_pkgcache(db), 1, trans->remove, NULL);
if(lp != NULL) {
if(trans->flags & PM_TRANS_FLAG_CASCADE) {
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 859b8c9..9f5bec3 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -102,7 +102,7 @@ int SYMEXPORT alpm_sync_sysupgrade(int enable_downgrade)
ASSERT(trans->state == STATE_INITIALIZED, RET_ERR(PM_ERR_TRANS_NOT_INITIALIZED, -1));
_alpm_log(PM_LOG_DEBUG, "checking for package upgrades\n");
- for(i = _alpm_db_get_pkgcache_list(db_local); i; i = i->next) {
+ for(i = _alpm_db_get_pkgcache(db_local); i; i = i->next) {
pmpkg_t *lpkg = i->data;
if(_alpm_pkg_find(trans->add, lpkg->name)) {
@@ -149,7 +149,7 @@ int SYMEXPORT alpm_sync_sysupgrade(int enable_downgrade)
break; /* jump to next local package */
} else { /* 2. search for replacers in sdb */
int found = 0;
- for(k = _alpm_db_get_pkgcache_list(sdb); k; k = k->next) {
+ for(k = _alpm_db_get_pkgcache(sdb); k; k = k->next) {
spkg = k->data;
if(alpm_list_find_str(alpm_pkg_get_replaces(spkg), lpkg->name)) {
found = 1;
@@ -331,7 +331,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
}
/* Compute the fake local database for resolvedeps (partial fix for the phonon/qt issue) */
- alpm_list_t *localpkgs = alpm_list_diff(_alpm_db_get_pkgcache_list(db_local), trans->add, _alpm_pkg_cmp);
+ alpm_list_t *localpkgs = alpm_list_diff(_alpm_db_get_pkgcache(db_local), trans->add, _alpm_pkg_cmp);
/* Resolve packages in the transaction one at a time, in addtion
building up a list of packages which could not be resolved. */
@@ -518,7 +518,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) {
_alpm_log(PM_LOG_DEBUG, "checking dependencies\n");
- deps = alpm_checkdeps(_alpm_db_get_pkgcache_list(db_local), 1, trans->remove, trans->add);
+ deps = alpm_checkdeps(_alpm_db_get_pkgcache(db_local), 1, trans->remove, trans->add);
if(deps) {
pm_errno = PM_ERR_UNSATISFIED_DEPS;
ret = -1;
diff --git a/src/pacman/deptest.c b/src/pacman/deptest.c
index 0d265c7..8895b48 100644
--- a/src/pacman/deptest.c
+++ b/src/pacman/deptest.c
@@ -41,7 +41,7 @@ int pacman_deptest(alpm_list_t *targets)
for(i = targets; i; i = alpm_list_next(i)) {
char *target = alpm_list_getdata(i);
- if(!alpm_find_satisfier(alpm_db_get_pkgcache_list(localdb), target)) {
+ if(!alpm_find_satisfier(alpm_db_get_pkgcache(localdb), target)) {
deps = alpm_list_add(deps, target);
}
}
diff --git a/src/pacman/query.c b/src/pacman/query.c
index 734875b..c79133d 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -170,7 +170,7 @@ static int query_fileowner(alpm_list_t *targets)
}
free(dname);
- for(i = alpm_db_get_pkgcache_list(db_local); i && !found; i = alpm_list_next(i)) {
+ for(i = alpm_db_get_pkgcache(db_local); i && !found; i = alpm_list_next(i)) {
alpm_list_t *j;
pmpkg_t *info = alpm_list_getdata(i);
@@ -228,7 +228,7 @@ static int query_search(alpm_list_t *targets)
searchlist = alpm_db_search(db_local, targets);
freelist = 1;
} else {
- searchlist = alpm_db_get_pkgcache_list(db_local);
+ searchlist = alpm_db_get_pkgcache(db_local);
freelist = 0;
}
if(searchlist == NULL) {
@@ -511,7 +511,7 @@ int pacman_query(alpm_list_t *targets)
return(1);
}
- for(i = alpm_db_get_pkgcache_list(db_local); i; i = alpm_list_next(i)) {
+ for(i = alpm_db_get_pkgcache(db_local); i; i = alpm_list_next(i)) {
pkg = alpm_list_getdata(i);
if(filter(pkg)) {
int value = display(pkg);
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 7af1667..26f6f82 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -328,7 +328,7 @@ static int sync_search(alpm_list_t *syncs, alpm_list_t *targets)
ret = alpm_db_search(db, targets);
freelist = 1;
} else {
- ret = alpm_db_get_pkgcache_list(db);
+ ret = alpm_db_get_pkgcache(db);
freelist = 0;
}
if(ret == NULL) {
@@ -469,7 +469,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets)
return(1);
}
- for(k = alpm_db_get_pkgcache_list(db); k; k = alpm_list_next(k)) {
+ for(k = alpm_db_get_pkgcache(db); k; k = alpm_list_next(k)) {
pmpkg_t *pkg = alpm_list_getdata(k);
if(strcmp(alpm_pkg_get_name(pkg), pkgstr) == 0) {
@@ -490,7 +490,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets)
for(j = syncs; j; j = alpm_list_next(j)) {
pmdb_t *db = alpm_list_getdata(j);
- for(k = alpm_db_get_pkgcache_list(db); k; k = alpm_list_next(k)) {
+ for(k = alpm_db_get_pkgcache(db); k; k = alpm_list_next(k)) {
pmpkg_t *pkg = alpm_list_getdata(k);
if(strcmp(alpm_pkg_get_name(pkg), pkgstr) == 0) {
@@ -511,7 +511,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets)
for(i = syncs; i; i = alpm_list_next(i)) {
pmdb_t *db = alpm_list_getdata(i);
- for(j = alpm_db_get_pkgcache_list(db); j; j = alpm_list_next(j)) {
+ for(j = alpm_db_get_pkgcache(db); j; j = alpm_list_next(j)) {
dump_pkg_sync(alpm_list_getdata(j), alpm_db_get_name(db), config->op_s_info);
}
}
@@ -555,7 +555,7 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets)
for(i = ls; i; i = alpm_list_next(i)) {
pmdb_t *db = alpm_list_getdata(i);
- for(j = alpm_db_get_pkgcache_list(db); j; j = alpm_list_next(j)) {
+ for(j = alpm_db_get_pkgcache(db); j; j = alpm_list_next(j)) {
pmpkg_t *pkg = alpm_list_getdata(j);
if (!config->quiet) {
diff --git a/src/util/cleanupdelta.c b/src/util/cleanupdelta.c
index 36a4e07..4403e9f 100644
--- a/src/util/cleanupdelta.c
+++ b/src/util/cleanupdelta.c
@@ -79,7 +79,7 @@ static void checkdbs(char *dbpath, alpm_list_t *dbnames) {
alpm_strerrorlast());
return;
}
- checkpkgs(alpm_db_get_pkgcache_list(db));
+ checkpkgs(alpm_db_get_pkgcache(db));
}
}
diff --git a/src/util/pactree.c b/src/util/pactree.c
index 947ed61..6a10006 100644
--- a/src/util/pactree.c
+++ b/src/util/pactree.c
@@ -303,7 +303,7 @@ static void walk_deps(pmpkg_t *pkg, int depth)
for(i = alpm_pkg_get_depends(pkg); i; i = alpm_list_next(i)) {
pmdepend_t *depend = alpm_list_getdata(i);
- pmpkg_t *provider = alpm_find_satisfier(alpm_db_get_pkgcache_list(db_local),
+ pmpkg_t *provider = alpm_find_satisfier(alpm_db_get_pkgcache(db_local),
alpm_dep_get_name(depend));
if(provider) {
@@ -347,7 +347,7 @@ int main(int argc, char *argv[])
/* we only care about the first non option arg for walking */
target_name = argv[optind];
- pkg = alpm_find_satisfier(alpm_db_get_pkgcache_list(db_local), target_name);
+ pkg = alpm_find_satisfier(alpm_db_get_pkgcache(db_local), target_name);
if(!pkg) {
fprintf(stderr, "error: package '%s' not found\n", target_name);
ret = 1;
diff --git a/src/util/testdb.c b/src/util/testdb.c
index 124a66d..461cf23 100644
--- a/src/util/testdb.c
+++ b/src/util/testdb.c
@@ -142,7 +142,7 @@ static int check_localdb(void) {
alpm_strerrorlast());
cleanup(EXIT_FAILURE);
}
- pkglist = alpm_db_get_pkgcache_list(db);
+ pkglist = alpm_db_get_pkgcache(db);
ret += checkdeps(pkglist);
ret += checkconflicts(pkglist);
return(ret);
@@ -162,7 +162,7 @@ static int check_syncdbs(alpm_list_t *dbnames) {
ret = 1;
goto cleanup;
}
- pkglist = alpm_db_get_pkgcache_list(db);
+ pkglist = alpm_db_get_pkgcache(db);
syncpkglist = alpm_list_join(syncpkglist, alpm_list_copy(pkglist));
}
ret += checkdeps(syncpkglist);
--
1.7.4.1
More information about the pacman-dev
mailing list