From 8d62835ba18a7fb662c2f3a23b86a16fe1386388 Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Fri, 13 Jul 2007 10:41:40 +0200 Subject: Remove conflict message for non-existent files (reworked) Signed-off-by: Chantry Xavier Signed-off-by: Dan McGee --- lib/libalpm/conflict.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 9ee89859..98f4d66e 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -431,8 +431,13 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) snprintf(path, PATH_MAX, "%s%s", root, filestr); - /* stat the file - if it exists and is not a dir, do some checks */ - if(lstat(path, &buf) == 0 && !S_ISDIR(buf.st_mode)) { + /* stat the file - if it exists, do some checks */ + if(lstat(path, &buf) != 0) { + continue; + } + if(S_ISDIR(buf.st_mode)) { + _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); + } else { _alpm_log(PM_LOG_DEBUG, "checking possible conflict: %s", path); /* Make sure the possible conflict is not a symlink that points to a @@ -496,9 +501,6 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) conflicts = add_fileconflict(conflicts, PM_CONFLICT_TYPE_FILE, path, p1->name, NULL); } - } else { - if(S_ISDIR(buf.st_mode)) - _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); } } alpm_list_free_inner(tmpfiles, &free); -- cgit v1.2.3-70-g09d2