1
votes

tldr; Would it be possible to force RPM to examine physical files on disk for changes when 'upgrading' a package with -U?

Current situation:

  1. install rpm a1
  2. an application modifies files from a1.
  3. rpm -V a shows the files being modified.
  4. install rpm a2 (with -U: Upgrade). This rpm contains mostly the same files from a1 (it's the next version, only some files are changed)
  5. rpm -V a shows that only some files are not restored to what was in the a2 rpm.

My best guess is that rpm compares only the md5 of the files from the already installed package a1 against files from package a2, and only when an md5 does not match it will look at the physical file. How would i force rpm to look at all files, as it does with -V ?

Example output of modified files:

/ # rpm -V a
missing   c /xxx/config/xyz.ini
S.5....T c /xxx/config/foo.xml
S.5....T c /xxx/config/firmware/xx.cfw
S.5....T c /xxx/config/bar.txt
S.5....T c /xxx/config/bar.xml

rpm -qc does list them.

1
Are the files in question marked as config files in the RPM? Does rpm -qc a list them? What is the rpm -V a output exactly? - Etan Reisner
With that pointer i found this: www-uxsup.csx.cam.ac.uk/~jw35/docs/rpm_config.html The rpm files are built with cmake, could it be that cmake by default adds all files as config files? - Mark Jansen
I doubt cmake is building the rpm packages itself. It almost certainly is just using an existing .spec file which has those marked as %config/%config(noreplace) files. If that's not what you want then you get to edit/fix the spec file to not do that. Given the config file marking if those are the files that aren't being updated then RPM is doing exactly what it is told. - Etan Reisner
I will look into it tomorrow (monday), but from what i have seen it is simply an issue of configuring cmake correctly, can you move your comment to an answer? - Mark Jansen
CMake does indeed generate a spec file, and all files that are added with absolute paths are marked with %config, all files added with relative paths are not marked as such. - Mark Jansen

1 Answers

1
votes

The behavior you describe is the correct behavior for files marked as %config(noreplace) in the RPM spec file. As that markeing indicates to rpm that the file is intended to be modified by the user/sysadmin and should not be replaced automatically on package upgrades.

I would check whether those files are listed that way in the spec file and whether or not that is the correct marking for those files.