summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-03-07 08:45:30 +0100
committerAaron Griffin <aaron@archlinux.org>2007-03-07 08:45:30 +0100
commit166ffc4f9e3bf3b0014c8c307f93af650fd24feb (patch)
tree578fc9393b80e07bec20f8684ca51685b646bb29 /lib
parent1a9e6015c7ab67c137be3e1d89b90e67b635b50b (diff)
downloadpacman-166ffc4f9e3bf3b0014c8c307f93af650fd24feb.tar.gz
pacman-166ffc4f9e3bf3b0014c8c307f93af650fd24feb.tar.xz
* Bug fix for makepkg dependency testing. This requires that we
expose alpm_splitdep and alpm_depcmp as public symbols * Removed a duplicate strtrim for question responses
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/alpm.h3
-rw-r--r--lib/libalpm/deps.c22
-rw-r--r--lib/libalpm/deps.h1
-rw-r--r--lib/libalpm/package.c2
-rw-r--r--lib/libalpm/trans.c2
-rw-r--r--lib/libalpm/versioncmp.c2
-rw-r--r--lib/libalpm/versioncmp.h2
7 files changed, 17 insertions, 17 deletions
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 40097162..366aeda3 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -375,6 +375,9 @@ typedef enum _pmdeptype_t {
PM_DEP_TYPE_CONFLICT
} pmdeptype_t;
+pmdepend_t *alpm_splitdep(const char *depstring);
+int alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep);
+
const char *alpm_dep_get_target(pmdepmissing_t *miss);
pmdeptype_t alpm_dep_get_type(pmdepmissing_t *miss);
pmdepmod_t alpm_dep_get_mod(pmdepmissing_t *miss);
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 247d9ff3..fd62ac89 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -142,7 +142,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode)
pmpkg_t *p = i->data;
_alpm_log(PM_LOG_DEBUG, " sorting %s", alpm_pkg_get_name(p));
for(j = alpm_pkg_get_depends(p); j; j = j->next) {
- pmdepend_t *depend = _alpm_splitdep(j->data);
+ pmdepend_t *depend = alpm_splitdep(j->data);
pmpkg_t *q = NULL;
if(depend == NULL) {
continue;
@@ -244,20 +244,20 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
}
for(k = alpm_pkg_get_depends(p); k; k = k->next) {
/* don't break any existing dependencies (possible provides) */
- pmdepend_t *depend = _alpm_splitdep(k->data);
+ pmdepend_t *depend = alpm_splitdep(k->data);
if(depend == NULL) {
continue;
}
/* if oldpkg satisfied this dep, and newpkg doesn't */
- if(_alpm_depcmp(oldpkg, depend) && !_alpm_depcmp(newpkg, depend)) {
+ if(alpm_depcmp(oldpkg, depend) && !alpm_depcmp(newpkg, depend)) {
/* we've found a dep that was removed... see if any other package
* still contains/provides the dep */
int satisfied = 0;
for(l = packages; l; l = l->next) {
pmpkg_t *pkg = l->data;
- if(_alpm_depcmp(pkg, depend)) {
+ if(alpm_depcmp(pkg, depend)) {
_alpm_log(PM_LOG_DEBUG, _("checkdeps: dependency '%s' has moved from '%s' to '%s'"),
depend->name, alpm_pkg_get_name(oldpkg), alpm_pkg_get_name(pkg));
satisfied = 1;
@@ -276,7 +276,7 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
continue;
}
- if(_alpm_depcmp(pkg, depend)) {
+ if(alpm_depcmp(pkg, depend)) {
_alpm_log(PM_LOG_DEBUG, _("checkdeps: dependency '%s' satisfied by installed package '%s'"),
depend->name, alpm_pkg_get_name(pkg));
satisfied = 1;
@@ -313,7 +313,7 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
for(j = alpm_pkg_get_depends(tp); j; j = j->next) {
/* split into name/version pairs */
- pmdepend_t *depend = _alpm_splitdep((char*)j->data);
+ pmdepend_t *depend = alpm_splitdep((char*)j->data);
if(depend == NULL) {
continue;
}
@@ -322,7 +322,7 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
/* check database for literal packages */
for(k = _alpm_db_get_pkgcache(db); k && !found; k = k->next) {
pmpkg_t *p = (pmpkg_t *)k->data;
- found = _alpm_depcmp(p, depend);
+ found = alpm_depcmp(p, depend);
}
/* check database for provides matches */
if(!found) {
@@ -345,14 +345,14 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
continue;
}
- found = _alpm_depcmp(p, depend);
+ found = alpm_depcmp(p, depend);
}
FREELISTPTR(k);
}
/* check other targets */
for(k = packages; k && !found; k = k->next) {
pmpkg_t *p = k->data;
- found = _alpm_depcmp(p, depend);
+ found = alpm_depcmp(p, depend);
}
/* else if still not found... */
if(!found) {
@@ -424,7 +424,7 @@ alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
return(baddeps);
}
-pmdepend_t *_alpm_splitdep(const char *depstring)
+pmdepend_t *alpm_splitdep(const char *depstring)
{
pmdepend_t *depend;
char *ptr = NULL;
@@ -517,7 +517,7 @@ alpm_list_t *_alpm_removedeps(pmdb_t *db, alpm_list_t *targs)
for(i = targs; i; i = i->next) {
pmpkg_t *pkg = i->data;
for(j = alpm_pkg_get_depends(pkg); j; j = j->next) {
- pmdepend_t *depend = _alpm_splitdep(j->data);
+ pmdepend_t *depend = alpm_splitdep(j->data);
pmpkg_t *deppkg;
if(depend == NULL) {
continue;
diff --git a/lib/libalpm/deps.h b/lib/libalpm/deps.h
index ede495d2..8f3a9b91 100644
--- a/lib/libalpm/deps.h
+++ b/lib/libalpm/deps.h
@@ -49,7 +49,6 @@ int _alpm_depmiss_isin(pmdepmissing_t *needle, alpm_list_t *haystack);
alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode);
alpm_list_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, pmtranstype_t op,
alpm_list_t *packages);
-pmdepend_t *_alpm_splitdep(const char *depstring);
alpm_list_t *_alpm_removedeps(pmdb_t *db, alpm_list_t *targs);
int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
alpm_list_t *list, alpm_list_t *trail, pmtrans_t *trans,
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index 340dc525..669af716 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -552,7 +552,7 @@ void _alpm_pkg_update_requiredby(pmpkg_t *pkg)
if(!j->data) {
continue;
}
- dep = _alpm_splitdep(j->data);
+ dep = alpm_splitdep(j->data);
if(dep == NULL) {
continue;
}
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 8097e9f8..3c58d8c8 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -272,7 +272,7 @@ int _alpm_trans_update_depends(pmtrans_t *trans, pmpkg_t *pkg)
localdb = alpm_option_get_localdb();
for(i = depends; i; i = i->next) {
- pmdepend_t* dep = _alpm_splitdep(i->data);
+ pmdepend_t* dep = alpm_splitdep(i->data);
if(dep == NULL) {
continue;
}
diff --git a/lib/libalpm/versioncmp.c b/lib/libalpm/versioncmp.c
index 67fe5ba4..51046848 100644
--- a/lib/libalpm/versioncmp.c
+++ b/lib/libalpm/versioncmp.c
@@ -247,7 +247,7 @@ int _alpm_versioncmp(const char *a, const char *b)
return(*one ? 1 : -1);
}
-int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep)
+int alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep)
{
int equal = 0;
diff --git a/lib/libalpm/versioncmp.h b/lib/libalpm/versioncmp.h
index 60ae7a2c..13a2d5a7 100644
--- a/lib/libalpm/versioncmp.h
+++ b/lib/libalpm/versioncmp.h
@@ -26,10 +26,8 @@
#include "deps.h"
#include "package.h"
-int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep);
int _alpm_versioncmp(const char *a, const char *b);
-
#endif /* _ALPM_VERSIONCMP_H */
/* vim: set ts=2 sw=2 noet: */