%config files and upgrade to F11 - consider noreplace

Paul Howarth paul at city-fan.org
Wed Feb 25 22:19:43 UTC 2009


On Wed, 25 Feb 2009 23:12:13 +0100
Miloslav Trmač <mitr at volny.cz> wrote:

> Bill Nottingham píše v St 25. 02. 2009 v 17:01 -0500:
> > Miloslav Trmač (mitr at volny.cz) said: 
> > > Because the Fedora 11 RPM packages will use SHA-256 for file
> > > digests in the RPM headers, upgrades from earlier releases to
> > > Fedora 11 will replace user-modified %config files (without
> > > noreplace) by their original versions, and rename the
> > > user-modified files to *.rpmsave.
> > > 
> > > The Fedora packaging guidelines already suggest using
> > > %config(noreplace) in most cases:
> > > https://fedoraproject.org/wiki/PackagingGuidelines#Configuration_files .
> > > 
> > > Please review use of %config without noreplace in your packages,
> > > and add noreplace if appropriate.  The list of affected packages
> > > is below.
> > 
> > Given that it's comparing hashes, and the old hash is *obviously*
> > of a different type than the new hash, why can't these sorts of
> > conflicts be caught?
> rpm recognizes that the hash changed, but what can it do?
> 
> - there is a config file
> - the config file was modified by the user
> - the update package may or may not contain a different version
>   of the config file than the old package.
> => the only things rpm can do is:
> - leave the modified config file as is
>   (this is what rpm does if the hashes are equal, i.e. the update 
>    doesn't change the config file)
>   X if the update did update the config file, the updated config file
>     would not be installed - but %config means the updated config file
>     should be installed
>   X this loses data (user would have to dig into the updated rpm
> package manually to get the updated config file, and would get no
>     notification about the unused updated config file)
> - save the updated config file as .rpmnew
>   X there would be no difference between %config and
> %config(noreplace), changing the semantics
> - save the modified config file as .rpmsave
>   X moves modified files to .rpmsave even if the update doesn't change
>     the config file

rpm could compute the old format hash of the config file it's about to
install and compare it with the old format hash (from the existing
rpmdb) of the installed and possibly modified config file; if the old
format hashes are the same, the config file did not change between the
old and new package and it can be left as-is.

Is there some flaw in that plan?

Paul.




More information about the fedora-devel-list mailing list