mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 15:58:50 -05:00
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>
This commit is contained in:
parent
d5a7dc67d9
commit
d0d8f605d5
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user