summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNagy Gabor <ngaba@bibl.u-szeged.hu>2008-05-01 23:58:33 +0200
committerDan McGee <dan@archlinux.org>2008-05-13 15:49:02 -0500
commit8248b4bfb1abe175d73e20106a18172da5296836 (patch)
treef7d806204fd511a00bb7f1c8cb7fde224130a72e
parente80232f24c51838d3f4ccff1fbc9c8fda87e1ecb (diff)
Swap the parameters of alpm_pkg_find
Now the syntax is coherent with alpm_list_find and alpm_sync_find. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--lib/libalpm/cache.c2
-rw-r--r--lib/libalpm/deps.c12
-rw-r--r--lib/libalpm/package.c2
-rw-r--r--lib/libalpm/package.h2
-rw-r--r--lib/libalpm/remove.c4
-rw-r--r--lib/libalpm/sync.c6
6 files changed, 14 insertions, 14 deletions
diff --git a/lib/libalpm/cache.c b/lib/libalpm/cache.c
index fcd555e9..d65b63b3 100644
--- a/lib/libalpm/cache.c
+++ b/lib/libalpm/cache.c
@@ -170,7 +170,7 @@ pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, const char *target)
return(NULL);
}
- return(_alpm_pkg_find(target, pkgcache));
+ return(_alpm_pkg_find(pkgcache, target));
}
/* Returns a new group cache from db.
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index b171ccc7..9cae0e2a 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -440,7 +440,7 @@ static int can_remove_package(pmdb_t *db, pmpkg_t *pkg, alpm_list_t *targets,
{
alpm_list_t *i, *j;
- if(_alpm_pkg_find(alpm_pkg_get_name(pkg), targets)) {
+ if(_alpm_pkg_find(targets, alpm_pkg_get_name(pkg))) {
return(0);
}
@@ -464,7 +464,7 @@ static int can_remove_package(pmdb_t *db, pmpkg_t *pkg, alpm_list_t *targets,
pmpkg_t *lpkg = i->data;
for(j = alpm_pkg_get_depends(lpkg); j; j = j->next) {
if(alpm_depcmp(pkg, j->data)) {
- if(!_alpm_pkg_find(lpkg->name, targets)) {
+ if(!_alpm_pkg_find(targets, lpkg->name)) {
return(0);
}
break;
@@ -571,8 +571,8 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
if(!sync) {
continue;
}
- found = alpm_depcmp(sync, missdep) && !_alpm_pkg_find(alpm_pkg_get_name(sync), remove)
- && !_alpm_pkg_find(alpm_pkg_get_name(sync), *list);
+ found = alpm_depcmp(sync, missdep) && !_alpm_pkg_find(remove, alpm_pkg_get_name(sync))
+ && !_alpm_pkg_find(*list, alpm_pkg_get_name(sync));
if(!found) {
continue;
}
@@ -594,8 +594,8 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
continue;
}
found = alpm_depcmp(sync, missdep) && strcmp(sync->name, missdep->name)
- && !_alpm_pkg_find(alpm_pkg_get_name(sync), remove)
- && !_alpm_pkg_find(alpm_pkg_get_name(sync), *list);
+ && !_alpm_pkg_find(remove, alpm_pkg_get_name(sync))
+ && !_alpm_pkg_find(*list, alpm_pkg_get_name(sync));
if(!found) {
continue;
}
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index 3989b76d..eabb2f3e 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -851,7 +851,7 @@ int _alpm_pkgname_pkg_cmp(const void *pkgname, const void *package)
/* Test for existence of a package in a alpm_list_t*
* of pmpkg_t*
*/
-pmpkg_t *_alpm_pkg_find(const char *needle, alpm_list_t *haystack)
+pmpkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle)
{
alpm_list_t *lp;
diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h
index 2e4ff31e..1efa64f4 100644
--- a/lib/libalpm/package.h
+++ b/lib/libalpm/package.h
@@ -81,7 +81,7 @@ void _alpm_pkg_free(pmpkg_t *pkg);
int _alpm_pkg_cmp(const void *p1, const void *p2);
int _alpm_pkgname_pkg_cmp(const void *pkgname, const void *package);
int _alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg);
-pmpkg_t *_alpm_pkg_find(const char *needle, alpm_list_t *haystack);
+pmpkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle);
int _alpm_pkg_should_ignore(pmpkg_t *pkg);
#endif /* _ALPM_PACKAGE_H */
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index f2e84ef5..c70e2b9e 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -56,7 +56,7 @@ int _alpm_remove_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(name != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
- if(_alpm_pkg_find(name, trans->packages)) {
+ if(_alpm_pkg_find(trans->packages, name)) {
RET_ERR(PM_ERR_TRANS_DUP_TARGET, -1);
}
@@ -92,7 +92,7 @@ static void remove_prepare_cascade(pmtrans_t *trans, pmdb_t *db,
pmdepmissing_t *miss = (pmdepmissing_t *)i->data;
pmpkg_t *info = _alpm_db_get_pkgfromcache(db, miss->target);
if(info) {
- if(!_alpm_pkg_find(alpm_pkg_get_name(info), trans->packages)) {
+ if(!_alpm_pkg_find(trans->packages, alpm_pkg_get_name(info))) {
_alpm_log(PM_LOG_DEBUG, "pulling %s in the targets list\n",
alpm_pkg_get_name(info));
trans->packages = alpm_list_add(trans->packages, _alpm_pkg_dup(info));
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 357b01f2..3743f9bb 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -227,7 +227,7 @@ int _alpm_sync_sysupgrade(pmtrans_t *trans,
for(i = _alpm_db_get_pkgcache(db_local); i; i = i->next) {
pmpkg_t *local = i->data;
- if(_alpm_pkg_find(alpm_pkg_get_name(local), replaced)) {
+ if(_alpm_pkg_find(replaced, alpm_pkg_get_name(local))) {
_alpm_log(PM_LOG_DEBUG, "'%s' is already elected for removal -- skipping\n",
alpm_pkg_get_name(local));
continue;
@@ -583,7 +583,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
int found = 0;
for(j = trans->packages; j && !found; j = j->next) {
pmsyncpkg_t *sync = j->data;
- if(_alpm_pkg_find(conflict->package2, sync->removes)) {
+ if(_alpm_pkg_find(sync->removes, conflict->package2)) {
found = 1;
}
}
@@ -954,7 +954,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data)
alpm_list_t *j;
for(j = sync->removes; j; j = j->next) {
pmpkg_t *pkg = j->data;
- if(!_alpm_pkg_find(pkg->name, tr->packages)) {
+ if(!_alpm_pkg_find(tr->packages, pkg->name)) {
if(_alpm_trans_addtarget(tr, pkg->name) == -1) {
goto error;
}