summaryrefslogtreecommitdiffstats
path: root/src/util/testdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/testdb.c')
-rw-r--r--src/util/testdb.c16
1 files changed, 11 insertions, 5 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);
}