summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/testdb.c16
-rw-r--r--src/util/testpkg.c2
2 files changed, 12 insertions, 6 deletions
diff --git a/src/util/testdb.c b/src/util/testdb.c
index 122a3fb5..87bfcf96 100644
--- a/src/util/testdb.c
+++ b/src/util/testdb.c
@@ -23,7 +23,6 @@
#include <errno.h>
#include <limits.h>
#include <string.h>
-#include <sys/stat.h>
#include <dirent.h>
#include <libgen.h>
@@ -61,7 +60,6 @@ static int db_test(char *dbpath)
{
struct dirent *ent;
char path[PATH_MAX];
- struct stat buf;
int ret = 0;
DIR *dir;
@@ -77,17 +75,17 @@ static int db_test(char *dbpath)
}
/* check for desc, depends, and files */
snprintf(path, PATH_MAX, "%s/%s/desc", dbpath, ent->d_name);
- if(stat(path, &buf)) {
+ if(access(path, F_OK)) {
printf("%s: description file is missing\n", ent->d_name);
ret++;
}
snprintf(path, PATH_MAX, "%s/%s/depends", dbpath, ent->d_name);
- if(stat(path, &buf)) {
+ if(access(path, F_OK)) {
printf("%s: dependency file is missing\n", ent->d_name);
ret++;
}
snprintf(path, PATH_MAX, "%s/%s/files", dbpath, ent->d_name);
- if(stat(path, &buf)) {
+ if(access(path, F_OK)) {
printf("%s: file list is missing\n", ent->d_name);
ret++;
}
@@ -147,6 +145,14 @@ int main(int argc, char **argv)
free(depstring);
}
+ /* check conflicts */
+ data = alpm_checkdbconflicts(db);
+ for(i = data; i; i = i->next) {
+ pmconflict_t *conflict = alpm_list_getdata(i);
+ printf("%s conflicts with %s\n", alpm_conflict_get_package1(conflict),
+ alpm_conflict_get_package2(conflict));
+ }
+
cleanup(retval);
}
diff --git a/src/util/testpkg.c b/src/util/testpkg.c
index 64056ce4..6e8f9d1c 100644
--- a/src/util/testpkg.c
+++ b/src/util/testpkg.c
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
case PM_ERR_PKG_OPEN:
printf("Cannot open the given file.\n");
break;
- case PM_ERR_LIBARCHIVE_ERROR:
+ case PM_ERR_LIBARCHIVE:
case PM_ERR_PKG_INVALID:
printf("Package is invalid.\n");
break;