index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2007-03-01 04:51:24 +0000 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-03-01 04:51:24 +0000 |
commit | af5cbf30840d128f2896a92527700cd4bd44322c (patch) | |
tree | 5e596a3193ef9ef36183186bbba54d829bc06f17 /src | |
parent | 77a9533b6446420a0868a5f940f682cc9b0c1706 (diff) |
-rw-r--r-- | src/pacman/package.c | 15 |
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); |