Coupling -V with -a when querying for specific packages makes little
sense and only causes the order of the output lines to depend on the
database ordering.
This is known to vary between the ndb and sqlite backends in particular,
confusing some of the tests that expect the lines to be in a specific
order.
While at it, fix all such questionable usages, even those that only
entail one package argument.
Fixes: #3242
glibc versions prior to 2020 know about AT_SYMLINK_NOFOLLOW but don't
actually implement it for fchmodat() and returns ENOSYS when used.
We don't check the return code in removeSBITS() so this silently fails
on those older versions.
We already verify the thing is not a link in the fstatat() condition
because cap_set_fileat() doesn't have any "dont follow" mode at all,
so we can just as well drop it from the fchmodat() and make this
work on more libc versions.
Add a test for the suid bit removal while at it.
Commit 2d52726bd5 was not SUPPOSED to
change any behavior, but it did: "shared" colored files (ie one being
wrong color and the other one actually installed) removed in the
same transaction would not get removed at all. Fix the embarrasment
that happens when you don't have systematic tests.
Fixes: #1800
Commit f311fb65ee added a step to reset
calculated states between rpmtsRun() calls to allow for %pretrans
hacks, but this causes actions set for --excludepath to get lost.
While those do get recalculated at the time of actual install and
correctly skipped, this causes them to be considered for file
disposition which they should not.
Files that are not installed cannot conflict with anything, any more
than skipped files can. The latter we handled, the former not. Strange
what "obvious" cases can go on unnoticed forever, when lacking systematic
tests.
Replace the two very basic file erase tests from "rpmdb" group with a more
elaborate set of tests in their own file. Some embarrassing failures
here, eg "shared" colored files getting left behind on erase. Oops.