summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-03-01 04:51:24 +0000
committerDan McGee <dan@archlinux.org>2007-03-01 04:51:24 +0000
commitaf5cbf30840d128f2896a92527700cd4bd44322c (patch)
tree5e596a3193ef9ef36183186bbba54d829bc06f17 /src
parent77a9533b6446420a0868a5f940f682cc9b0c1706 (diff)
* Updated Italian translation
Giovanni Scafora <linuxmania@gmail.com> * Fixed FS #6442 - don't list directories in -Ql output.
Diffstat (limited to 'src')
-rw-r--r--src/pacman/package.c15
1 files changed, 12 insertions, 3 deletions
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);