From bd43a7f155cbd54d58fb45285e2eef1f51c88b00 Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Sat, 8 Dec 2007 00:17:34 +0100 Subject: testdb : add conflicts checking. Testdb will now scan the local database to check there are no conflicts. I'm not sure how it's possible to get this situation. At least pacman doesn't allow installing a package that conflicts with a local one, without removing the local one. But maybe in a very weird situation, or because of a bug, it could be possible. But anyway, this only requires 5 lines of code. Signed-off-by: Chantry Xavier Signed-off-by: Dan McGee --- src/util/testdb.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/util/testdb.c b/src/util/testdb.c index 122a3fb5..f354ecab 100644 --- a/src/util/testdb.c +++ b/src/util/testdb.c @@ -147,6 +147,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); } -- cgit v1.2.3-24-g4f1b