Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-10-21 20:16:55 +0000
committerAaron Griffin <aaron@archlinux.org>2006-10-21 20:16:55 +0000
commit93311212bddb7d7e75ea91f04604ca42e85ef823 (patch)
tree9c754fe464adcb840c090db27dba01f4615393ba
parentdf0dac10e5bbace9ceeeffce19d8a16e5bc3ae21 (diff)
Fixes from frugalware: few 'typos' included while patching
Also re-added Judd's dependancy fix in libalpm/deps.c
-rw-r--r--Makefile.am2
-rw-r--r--bindings/alpm.i2
-rw-r--r--lib/libalpm/alpm.c3
-rw-r--r--lib/libalpm/db.c1
-rw-r--r--lib/libalpm/deps.c40
-rw-r--r--lib/libalpm/server.h1
6 files changed, 33 insertions, 16 deletions
diff --git a/Makefile.am b/Makefile.am
index a980d04e..cb42571f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,7 +17,7 @@ EXTRA_DIST = \
TODO \
TODO.autoconf
-check:
+check: src/pacman
cd pactest; python pactest.py --test=tests/*.py -p ../src/pacman/pacman --debug=-1
tags:
diff --git a/bindings/alpm.i b/bindings/alpm.i
index dc4d680e..49541b91 100644
--- a/bindings/alpm.i
+++ b/bindings/alpm.i
@@ -10,7 +10,7 @@
/* Create casting functions */
-%pointer_cast(char *, long *, void_to_long);
+%pointer_cast(void *, long *, void_to_long);
%pointer_cast(void *, char *, void_to_char);
%pointer_cast(void *, unsigned long, void_to_unsigned_long);
%pointer_cast(void *, PM_LIST *, void_to_PM_LIST);
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index 5868ddfe..386eee4d 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -303,6 +303,7 @@ int alpm_db_setserver(pmdb_t *db, char *url)
/** Update a package database
* @param force if true, then forces the update, otherwise update only in case
+ * the database isn't up to date
* @param db pointer to the package database to update
* @return 0 on success, > 0 on error (pm_errno is set accordingly), < 0 if up
* to date
@@ -996,7 +997,7 @@ void *alpm_dep_getinfo(pmdepmissing_t *miss, unsigned char parm)
}
/** @} */
-/** @defgroup alpm_dep File Conflicts Functions
+/** @defgroup alpm_conflict File Conflicts Functions
* @brief Functions to get informations about a libalpm file conflict
* @{
*/
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 39134680..fe421261 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -124,7 +124,6 @@ pmlist_t *_alpm_db_search(pmdb_t *db, pmlist_t *needles)
} else if(retval) {
_alpm_log(PM_LOG_DEBUG, " search target '%s' matched '%s'", targ, haystack);
match = 1;
- } else {
}
FREE(haystack);
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 8249c651..2d28fde0 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -307,11 +307,28 @@ pmlist_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, unsigned char op, pmlist
}
}
}
- /* check other targets */
- for(k = packages; k && !found; k = k->next) {
- pmpkg_t *p = (pmpkg_t *)k->data;
- /* see if the package names match OR if p provides depend.name */
- if(!strcmp(p->name, depend.name) || _alpm_list_is_strin(depend.name, p->provides)) {
+ /* check database for provides matches */
+ if(!found) {
+ pmlist_t *m;
+ k = _alpm_db_whatprovides(db, depend.name);
+ for(m = k; m && !found; m = m->next) {
+ /* look for a match that isn't one of the packages we're trying
+ * to install. this way, if we match against a to-be-installed
+ * package, we'll defer to the NEW one, not the one already
+ * installed. */
+ pmpkg_t *p = m->data;
+ pmlist_t *n;
+ int skip = 0;
+ for(n = packages; n && !skip; n = n->next) {
+ pmpkg_t *ptp = n->data;
+ if(!strcmp(ptp->name, p->name)) {
+ skip = 1;
+ }
+ }
+ if(skip) {
+ continue;
+ }
+
if(depend.mod == PM_DEP_MOD_ANY) {
/* accept any version */
found = 1;
@@ -334,13 +351,13 @@ pmlist_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, unsigned char op, pmlist
FREE(ver);
}
}
+ FREELISTPTR(k);
}
- /* check database for provides matches */
- if(!found){
- k = _alpm_db_whatprovides(db, depend.name);
- if(k) {
- /* grab the first one (there should only really be one, anyway) */
- pmpkg_t *p = k->data;
+ /* check other targets */
+ for(k = packages; k && !found; k = k->next) {
+ pmpkg_t *p = (pmpkg_t *)k->data;
+ /* see if the package names match OR if p provides depend.name */
+ if(!strcmp(p->name, depend.name) || _alpm_list_is_strin(depend.name, p->provides)) {
if(depend.mod == PM_DEP_MOD_ANY) {
/* accept any version */
found = 1;
@@ -362,7 +379,6 @@ pmlist_t *_alpm_checkdeps(pmtrans_t *trans, pmdb_t *db, unsigned char op, pmlist
}
FREE(ver);
}
- FREELISTPTR(k);
}
}
/* else if still not found... */
diff --git a/lib/libalpm/server.h b/lib/libalpm/server.h
index f3dad39b..218c172a 100644
--- a/lib/libalpm/server.h
+++ b/lib/libalpm/server.h
@@ -22,6 +22,7 @@
#define _ALPM_SERVER_H
#include "list.h"
+#include <time.h>
#include <ftplib.h>
#define FREESERVER(p) \