From 941c23025c886b820af8a17959bdf6dc4c2c0c9a Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 21 Mar 2007 03:08:19 +0000 Subject: * Fix asking the user to upgrade when using -Sp * More significant error messages when -Qo fails * Potential fix for reported error that pacman indicates corrupt packages when space is full on the cache dir --- src/pacman/query.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pacman/query.c b/src/pacman/query.c index 76cbc7fc..e7e9cf92 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -57,8 +58,18 @@ static void query_fileowner(pmdb_t *db, char *filename) return; } - if(stat(filename, &buf) == -1 || S_ISDIR(buf.st_mode) || realpath(filename, rpath) == NULL) { - /* fail silently if we're a directory */ + if(stat(filename, &buf) == -1) { + ERR(NL, _("failed to read file '%s': %s"), filename, strerror(errno)); + return; + } + + if(S_ISDIR(buf.st_mode)) { + ERR(NL, _("can not determine ownership of a directory")); + return; + } + + if(realpath(filename, rpath) == NULL) { + ERR(NL, _("cannot determine real path for '%s': %s"), filename, strerror(errno)); return; } -- cgit v1.2.3-24-g4f1b