summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Chantry <chantry.xavier@gmail.com>2010-10-12 21:47:40 +0200
committerDan McGee <dan@archlinux.org>2010-12-12 20:08:54 -0600
commitd0d8f605d5f3ff8fc306af90ea2a516174354bfc (patch)
tree44541a2d3d54f9d857606cbdb64dc118c4668d96
parentd5a7dc67d93f5e530a6b3611f567eff5afe76efb (diff)
downloadpacman-d0d8f605d5f3ff8fc306af90ea2a516174354bfc.tar.xz
alpm: don't expose alpm_depcmp
Either we expose all low levels function dealing with pmdepend_t (splitdep and depfree come to mind), or we don't. Since none of the tools use depcmp, I chose to remove it. In the future, we might want to expose higher level functions such as alpm_find_satisfier, or just lower level functions like splitdep and depfree together with depcmp. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--lib/libalpm/alpm.h1
-rw-r--r--lib/libalpm/conflict.c2
-rw-r--r--lib/libalpm/deps.c10
-rw-r--r--lib/libalpm/deps.h1
-rw-r--r--lib/libalpm/sync.c4
5 files changed, 9 insertions, 9 deletions
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index cd70643c..237e2356 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -429,7 +429,6 @@ typedef enum _pmdepmod_t {
PM_DEP_MOD_LT
} pmdepmod_t;
-int alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep);
alpm_list_t *alpm_checkdeps(alpm_list_t *pkglist, int reversedeps,
alpm_list_t *remove, alpm_list_t *upgrade);
pmpkg_t *alpm_find_satisfier(alpm_list_t *pkgs, const char *depstring);
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index f3cb9b59..2b0efa5a 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -109,7 +109,7 @@ static int does_conflict(pmpkg_t *pkg1, const char *conflict, pmpkg_t *pkg2)
pmdepend_t *conf = _alpm_splitdep(conflict);
int match = 0;
- match = alpm_depcmp(pkg2, conf);
+ match = _alpm_depcmp(pkg2, conf);
if(match) {
_alpm_log(PM_LOG_DEBUG, "package %s conflicts with %s (by %s)\n",
pkg1name, pkg2name, conflict);
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index a9410785..cdaf5243 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -195,7 +195,7 @@ pmpkg_t *_alpm_find_dep_satisfier(alpm_list_t *pkgs, pmdepend_t *dep)
for(i = pkgs; i; i = alpm_list_next(i)) {
pmpkg_t *pkg = i->data;
- if(alpm_depcmp(pkg, dep)) {
+ if(_alpm_depcmp(pkg, dep)) {
return(pkg);
}
}
@@ -319,7 +319,7 @@ static int dep_vercmp(const char *version1, pmdepmod_t mod,
return(equal);
}
-int SYMEXPORT alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep)
+int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep)
{
alpm_list_t *i;
@@ -513,7 +513,7 @@ pmpkg_t *_alpm_resolvedep(pmdepend_t *dep, alpm_list_t *dbs,
/* 1. literals */
for(i = dbs; i; i = i->next) {
pmpkg_t *pkg = _alpm_db_get_pkgfromcache(i->data, dep->name);
- if(pkg && alpm_depcmp(pkg, dep) && !_alpm_pkg_find(excluding, pkg->name)) {
+ if(pkg && _alpm_depcmp(pkg, dep) && !_alpm_pkg_find(excluding, pkg->name)) {
if(_alpm_pkg_should_ignore(pkg)) {
int install = 0;
if (prompt) {
@@ -534,7 +534,7 @@ pmpkg_t *_alpm_resolvedep(pmdepend_t *dep, alpm_list_t *dbs,
for(i = dbs; i; i = i->next) {
for(j = _alpm_db_get_pkgcache(i->data); j; j = j->next) {
pmpkg_t *pkg = j->data;
- if(alpm_depcmp(pkg, dep) && strcmp(pkg->name, dep->name) != 0 &&
+ if(_alpm_depcmp(pkg, dep) && strcmp(pkg->name, dep->name) != 0 &&
!_alpm_pkg_find(excluding, pkg->name)) {
if(_alpm_pkg_should_ignore(pkg)) {
int install = 0;
@@ -660,7 +660,7 @@ int _alpm_dep_edge(pmpkg_t *pkg1, pmpkg_t *pkg2)
{
alpm_list_t *i;
for(i = alpm_pkg_get_depends(pkg1); i; i = i->next) {
- if(alpm_depcmp(pkg2, i->data)) {
+ if(_alpm_depcmp(pkg2, i->data)) {
return(1);
}
}
diff --git a/lib/libalpm/deps.h b/lib/libalpm/deps.h
index ffc3aeeb..6fa763e1 100644
--- a/lib/libalpm/deps.h
+++ b/lib/libalpm/deps.h
@@ -55,6 +55,7 @@ int _alpm_resolvedeps(alpm_list_t *localpkgs, alpm_list_t *dbs_sync, pmpkg_t *pk
int _alpm_dep_edge(pmpkg_t *pkg1, pmpkg_t *pkg2);
pmdepend_t *_alpm_splitdep(const char *depstring);
pmpkg_t *_alpm_find_dep_satisfier(alpm_list_t *pkgs, pmdepend_t *dep);
+int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep);
#endif /* _ALPM_DEPS_H */
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 1e73b8b0..8609ed53 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -528,10 +528,10 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
/* if sync1 provides sync2, we remove sync2 from the targets, and vice versa */
pmdepend_t *dep1 = _alpm_splitdep(conflict->package1);
pmdepend_t *dep2 = _alpm_splitdep(conflict->package2);
- if(alpm_depcmp(sync1, dep2)) {
+ if(_alpm_depcmp(sync1, dep2)) {
rsync = sync2;
sync = sync1;
- } else if(alpm_depcmp(sync2, dep1)) {
+ } else if(_alpm_depcmp(sync2, dep1)) {
rsync = sync1;
sync = sync2;
} else {