[Rpm-maint] rpm --verify and replaced files

Panu Matilainen pmatilai at laiskiainen.org
Fri Apr 12 10:55:56 UTC 2013

On 04/09/2013 11:40 AM, Michael Schroeder wrote:
> On Tue, Apr 09, 2013 at 08:32:57AM +0300, Panu Matilainen wrote:
>> I suppose the idea has been not to complain when its "known broken", ie
>> installed with --replacefiles or --force. The kinda legitimate use-case for
>> that would be replacing %config files from another package, for everything
>> else forced files pretty much of course equals broken package. I agree it
>> would be good to somehow note this in the --verify output, but since the
>> verification output is the way it is... ideas welcome.
>> One possibility might be adding another "field" to the output where any
>> non-regular state is shown as a one-letter abbreviation (such as R for
>> replaced, W for wrongcolor etc).
> Yes, that would work for me. Another easy bandaid is to add an option
> to make verify report bad replaced files.

...and done: 

I ended up with a slightly different variant to avoid breaking every 
single 'rpm -V' related script in existence: the state is appeneded to 
the end of the line, similar to strerror() message on unexpected errors. 
In verbose mode all non-normal states are shown, but otherwise only the 
replaced state triggers the verify output. Eg:

[root at localhost rpm]# ./rpm -U --nodocs /tmp/telnet-0.17-54.fc18.x86_64.rpm
[root at localhost rpm]# ./rpm -V telnet
[root at localhost rpm]# ./rpm -Vv telnet
.........    /usr/bin/telnet
.........    /usr/share/doc/telnet-0.17 (not installed)
.........  d /usr/share/doc/telnet-0.17/README (not installed)
.........  d /usr/share/man/man1/telnet.1.gz (not installed)
[root at localhost rpm]# ./rpm -e telnet
[root at localhost rpm]# ./rpm -U /tmp/telnet-0.17-54.fc18.x86_64.rpm
[root at localhost rpm]# ./rpm -U --force 
[root at localhost rpm]# ./rpm -V telnet
.........    /usr/bin/telnet (replaced)
[root at localhost rpm]#

The output on (replaced) case makes me wonder... with the state 
information there now, perhaps it should actually just verify the file 
anyway, so you could easily tell whether the replacing file only differs 
by permissions or by actual content.

	- Panu -

More information about the Rpm-maint mailing list