diff options
author | jbj <devnull@localhost> | 2001-06-20 21:20:16 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-06-20 21:20:16 +0000 |
commit | 60977b6c27aca83d1c15deef2e4f759268308075 (patch) | |
tree | 1f5d83a78c21801f5f9c2c7d3b03a051f3a41bce /lib/query.c | |
parent | 6f88379b75dd5a0f029e709d29a3c10f40b76102 (diff) | |
download | librpm-tizen-60977b6c27aca83d1c15deef2e4f759268308075.tar.gz librpm-tizen-60977b6c27aca83d1c15deef2e4f759268308075.tar.bz2 librpm-tizen-60977b6c27aca83d1c15deef2e4f759268308075.zip |
- fix: rpm -qlv link count for directories dinna include '..'.
- fix: rpm -qlv size for directories should be zero.
- add --noghost to filter non-payload files from rpm -qlv output.
CVS patchset: 4897
CVS date: 2001/06/20 21:20:16
Diffstat (limited to 'lib/query.c')
-rw-r--r-- | lib/query.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/query.c b/lib/query.c index c25d37a1c..32c613f8e 100644 --- a/lib/query.c +++ b/lib/query.c @@ -246,6 +246,11 @@ int showQueryPackage(QVA_t qva, /*@unused@*/rpmdb rpmdb, Header h) && !(fileFlagsList[i] & RPMFILE_CONFIG)) continue; + /* If not querying %ghost, skip ghost files. */ + if (!(qva->qva_fflags & RPMFILE_GHOST) + && (fileFlagsList[i] & RPMFILE_GHOST)) + continue; + if (!rpmIsVerbose() && prefix) te = stpcpy(te, prefix); @@ -306,15 +311,22 @@ int showQueryPackage(QVA_t qva, /*@unused@*/rpmdb rpmdb, Header h) } else { char * filespec; int nlink; + size_t fileSize; filespec = xmalloc(strlen(dirNames[dirIndexes[i]]) + strlen(baseNames[i]) + 1); strcpy(filespec, dirNames[dirIndexes[i]]); strcat(filespec, baseNames[i]); + fileSize = fileSizeList[i]; nlink = countLinks(fileRdevList, fileInodeList, count, i); + +if (S_ISDIR(fileModeList[i])) { + nlink++; + fileSize = 0; +} if (fileOwnerList && fileGroupList) { - printFileInfo(te, filespec, fileSizeList[i], + printFileInfo(te, filespec, fileSize, fileModeList[i], fileMTimeList[i], fileRdevList[i], nlink, fileOwnerList[i], @@ -322,7 +334,7 @@ int showQueryPackage(QVA_t qva, /*@unused@*/rpmdb rpmdb, Header h) -1, fileLinktoList[i]); te += strlen(te); } else if (fileUIDList && fileGIDList) { - printFileInfo(te, filespec, fileSizeList[i], + printFileInfo(te, filespec, fileSize, fileModeList[i], fileMTimeList[i], fileRdevList[i], nlink, NULL, NULL, fileUIDList[i], |