Fix %ghost verification and --noghost behavior (RhBug:1395818)

Verify has "always" accepted --noghost as an option but it's always
been broken too, the --noghost option used to *clear* the bit on
qva_fflags, bit which nothing set in the first place. When you
test that bit for enabling verify on ghosts, chances are the ghosts
remain ethereal...

That was until commit efd696d32d fixed
the bit clear to set to make --noghost work on queries, but hardwired
the verify code to no ghosts. Wtf?

So... after 15 years of existence (commit
60977b6c27) and somewhat colorful
history, lets make it work and document it too. qva_fflags is supposed
to be a "filter out if matching attribute in file" bitfield but its been
kinda hard to tell when there was one example left which had it the wrong
way around. The original commit has two more examples where the bit setting
is right but disabled with "ifdef NEVER" ... since removed.
This commit is contained in:
Panu Matilainen 2016-11-17 10:01:09 +02:00
parent e1f847db58
commit bb27f9fffa
2 changed files with 4 additions and 1 deletions

View File

@ -742,6 +742,9 @@ Don't verify package or header digests when reading.
\fB--nofiles\fR
Don't verify any attributes of package files.
.TP
\fB--noghost\fR
Don't verify ghost files.
.TP
\fB--noscripts\fR
Don't execute the \fB%verifyscript\fR scriptlet (if any).
.TP

View File

@ -505,7 +505,7 @@ static int verifyDependencies(rpmts ts, Header h)
int showVerifyPackage(QVA_t qva, rpmts ts, Header h)
{
rpmVerifyAttrs omitMask = ((qva->qva_flags & VERIFY_ATTRS) ^ VERIFY_ATTRS);
int ghosts = 0;
int ghosts = !(qva->qva_fflags & RPMFILE_GHOST);
int ec = 0;
int rc;