- 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
- fix: partial sets of hardlinked files permitted in payload.
- fix: mark rpmdb files with %config to prevent erasure on downgrade.
- work around a (possible) compiler problem on ia64.
+ - 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.
4.0 -> 4.0.[12]
- add doxygen and lclint annotations most everywhere.
break;
case FA_BACKUP:
+ if (!(fsm->fflags & RPMFILE_GHOST)) /* XXX Don't if %ghost file. */
switch (fi->type) {
case TR_ADDED:
fsm->osuffix = SUFFIX_RPMORIG;
case FA_ALTNAME:
assert(fi->type == TR_ADDED);
- fsm->nsuffix = SUFFIX_RPMNEW;
+ if (!(fsm->fflags & RPMFILE_GHOST)) /* XXX Don't if %ghost file. */
+ fsm->nsuffix = SUFFIX_RPMNEW;
break;
case FA_SAVE:
assert(fi->type == TR_ADDED);
- fsm->osuffix = SUFFIX_RPMSAVE;
+ if (!(fsm->fflags & RPMFILE_GHOST)) /* XXX Don't if %ghost file. */
+ fsm->osuffix = SUFFIX_RPMSAVE;
break;
case FA_ERASE:
assert(fi->type == TR_REMOVED);
+ /*
+ * XXX TODO: %ghost probably shouldn't be removed, but that changes
+ * legacy rpm behavior.
+ */
break;
default:
break;
N_("dump basic file information"), NULL },
{ "list", 'l', 0, 0, 'l',
N_("list files in package"), NULL },
+
+ /* Duplicate file attr flags from packages into command line options. */
+ { "noghost", '\0', POPT_BIT_CLR|POPT_ARGFLAG_DOC_HIDDEN,
+ &rpmQVArgs.qva_fflags, RPMFILE_GHOST,
+ N_("skip %%ghost files"), NULL },
+#ifdef NOTEVER /* XXX there's hardly a need for these */
+ { "nolicense", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
+ &rpmQVArgs.qva_fflags, RPMFILE_LICENSE,
+ N_("skip %%license files"), NULL },
+ { "noreadme", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
+ &rpmQVArgs.qva_fflags, RPMFILE_README,
+ N_("skip %%readme files"), NULL },
+#endif
+
{ "qf", '\0', POPT_ARG_STRING | POPT_ARGFLAG_DOC_HIDDEN, 0,
POPT_QUERYFORMAT, NULL, NULL },
{ "queryformat", '\0', POPT_ARG_STRING, 0, POPT_QUERYFORMAT,
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmQVSourcePoptTable, 0,
NULL, NULL },
+ /* Duplicate file verify flags from packages into command line options. */
{ "nomd5", '\0', POPT_BIT_SET, &rpmQVArgs.qva_flags, VERIFY_MD5,
N_("don't verify MD5 digest of files"), NULL },
{ "nosize", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
N_("don't verify package dependencies"), NULL },
{ "noscript", '\0', POPT_BIT_SET,&rpmQVArgs.qva_flags, VERIFY_SCRIPT,
N_("don't execute %verifyscript (if any)"), NULL },
+ /* XXX legacy had a trailing s on --noscript */
{ "noscripts", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
&rpmQVArgs.qva_flags, VERIFY_SCRIPT,
N_("don't execute %verifyscript (if any)"), NULL },
&& !(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);
} 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],
-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],
rpmQVSources qva_source; /*!< Identify CLI arg type. */
int qva_sourceCount;/*!< Exclusive check (>1 is error). */
rpmQueryFlags qva_flags; /*!< Bit(s) to control operation. */
+ rpmfileAttrs qva_fflags; /*!< Bit(s) to filter on attribute. */
/*@unused@*/ int qva_verbose; /*!< (unused) */
/*@only@*/ /*@null@*/ const char * qva_queryFormat; /*!< Format for headerSprintf(). */
/*@observer@*/ /*@null@*/ const char * qva_prefix; /*!< Path to top of install tree. */
#define RPMFILE_MULTILIB(N) ((N) << RPMFILE_MULTILIB_SHIFT)
#define RPMFILE_MULTILIB_MASK RPMFILE_MULTILIB(7)
+#define RPMFILE_ALL ~(RPMFILE_NONE)
+
/* XXX Check file flags for multilib marker. */
#define isFileMULTILIB(_fflags) ((_fflags) & RPMFILE_MULTILIB_MASK)
int rc;
fileAttrs = fileFlags[i];
+
+ /* If not verifying %ghost, skip ghost files. */
+ if (!(qva->qva_fflags & RPMFILE_GHOST)
+ && (fileAttrs & RPMFILE_GHOST))
+ continue;
+
rc = rpmVerifyFile(prefix, h, i, &verifyResult, omitMask);
if (rc) {
if (!(fileAttrs & RPMFILE_MISSINGOK) || rpmIsVerbose()) {
%config(noreplace,missingok) /etc/rpm/macros.db1
%attr(0755, @RPMUSER@, @RPMGROUP@) %dir /var/lib/rpm
-%define rpmdbattr %attr(0644, @RPMUSER@, @RPMGROUP@) %verify(not md5 size mtime) %ghost %config(missingok)
+%define rpmdbattr %attr(0644, @RPMUSER@, @RPMGROUP@) %verify(not md5 size mtime) %ghost %config(missingok,noreplace)
%rpmdbattr /var/lib/rpm/Basenames
%rpmdbattr /var/lib/rpm/Conflictname
%rpmdbattr /var/lib/rpm/__db.001
qva->qva_queryFormat = _free(qva->qva_queryFormat);
memset(qva, 0, sizeof(*qva));
qva->qva_source = RPMQV_PACKAGE;
+ qva->qva_fflags = RPMFILE_ALL;
qva->qva_mode = ' ';
qva->qva_char = ' ';
#endif