Re: %config, %config(noreplace) and %post-install actions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for your considered reply.  If I fully understand it, your
approach would write an .rpmnew on upgrade only if post-localization
changes resulted in a file with different contents.  That's great, such
as it is, but it doesn't give a config file that will "verify" with rpm
-V, which is really my problem, since a config file that doesn't verify
will, upon upgrade, be either replaced (.rpmsave) or supplemented
(.rpmnew), even when that is not needed (localization results in same
file).  

The semantics of %config and %config(noreplace) already (always!!) give
me backups of my localized %config files upon upgrade.  What I am
getting is redundant .rpmnew/.rpmsave config files, where I don't need
them.  Hmmm, maybe I should just have a post-install task to diff config
files with .rpmsave/.rpmnew variants and delete the excess?  That way,
as with your solution (but perhaps with less effort), I'll not have
redundant config files lying around.  However, rpm -V will still show
that the config file differs from what was installed, and I'd still
prefer a way to change rpm's idea of what the installed file's MD5 was.

Adam

On Thu, 2005-07-07 at 11:38, Rodrigo Barbosa wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Thu, Jul 07, 2005 at 11:13:37AM -0400, Adam Welch wrote:

<snipped to make msg < 4kb>

> This is actually a very complicated issue, the "spirit of RPM".
> First, you have to look at the "spirit of package management".
> 
> You see, when you are distributing a package, the packaging system
> (for us, RPM) needs to know what the files are like (owner, mode, md5 etc).
> This is particularly important when you want to verify system
> consistency (rpm -V), or decide what to update.
> 
> What I would decomend for this case is to have a .dist file. Lets say,
> /etc/soft/conf.dist. Then, on %post, you will do whatever changes you
> want to this file saving as /etc/soft/conf.dist.tmp. After that,
> you can see if the configuration file exists (/etc/soft/conf). If it
> doesn't, just move /etc/soft/conf.dist.tmp to /etc/soft/conf. Otherwise,
> run a small diff to detect changes. If you are doing the same customization,
> then will be no differences, and you can just delete the .tmp file. Otherwise,
> move it to conf.rpmnew.
> 
> Don't forget, of course, to make /etc/soft/conf as a %ghost file.
> Maybe even using %noverify. This way, you can still have it removed
> when you remove the package.
> 
> What you can acomplish with this is having the package consistent, since
> you are distributing the .dist file, which can be managed by RPM without
> greater issues.
> 
> - -- 
> Rodrigo Barbosa <rodrigob@xxxxxxxxxxxxxxx>
> "Quid quid Latine dictum sit, altum viditur"
> "Be excellent to each other ..." - Bill & Ted (Wyld Stallyns)
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.0 (GNU/Linux)
> 
> iD8DBQFCzUxkpdyWzQ5b5ckRAtbBAKCRJgIKEUZ9j7dZ/m6h0+0fU4xc6gCeL5Xg
> VIOzc9anbjHyfQSeAHwh2hM=
> =cwaL
> -----END PGP SIGNATURE-----
> 
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/rpm-list


[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux