From af5cbf30840d128f2896a92527700cd4bd44322c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 1 Mar 2007 04:51:24 +0000 Subject: * Updated Italian translation Giovanni Scafora * Fixed FS #6442 - don't list directories in -Ql output. --- src/pacman/package.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/pacman/package.c b/src/pacman/package.c index ad629f73..d5a3d04e 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -208,15 +208,24 @@ void dump_pkg_backups(pmpkg_t *pkg) */ void dump_pkg_files(pmpkg_t *pkg) { - const char *pkgname; + const char *pkgname, *root, *filestr; alpm_list_t *i, *pkgfiles; + struct stat buf; + char path[PATH_MAX]; pkgname = alpm_pkg_get_name(pkg); pkgfiles = alpm_pkg_get_files(pkg); + root = alpm_option_get_root(); for(i = pkgfiles; i; i = alpm_list_next(i)) { - fprintf(stdout, "%s %s%s\n", pkgname, alpm_option_get_root(), - (char *)alpm_list_getdata(i)); + 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 */ + } else { + fprintf(stdout, "%s %s\n", pkgname, path); + } } fflush(stdout); -- cgit v1.2.3-70-g09d2