diff --git a/src/pacman/package.c b/src/pacman/package.c index c91384d9..a30260ae 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -222,14 +223,18 @@ void dump_pkg_files(pmpkg_t *pkg) filestr = (char*)alpm_list_getdata(i); /* build a path so we can stat the filename */ snprintf(path, PATH_MAX-1, "%s%s", root, filestr); - if(!stat(path, &buf) && S_ISDIR(buf.st_mode)) { - /* if we stat it and it is a dir, don't print */ + if(!lstat(path, &buf)) { + if(!S_ISDIR(buf.st_mode)) { + /* don't print directories */ + fprintf(stdout, "%s %s\n", pkgname, path); + } } else { - fprintf(stdout, "%s %s\n", pkgname, path); + fprintf(stderr, "%s %s : %s\n", pkgname, path, strerror(errno)); } } fflush(stdout); + fflush(stderr); } /* Display the changelog of an installed package