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

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Jul 07, 2005 at 11:13:37AM -0400, Adam Welch wrote:
> I like the semantics of %config and %config(noreplace).  However, I find
> that I'd often like to make small modifications to config files as part
> of post-installation, and not have these modifications trigger the
> .rpmsave or .rpmnew on the next upgrade.  You see, often the
> configuration modifications that I make in post-install are of the
> "localization" variety, rather than the "customization" variety.  I'd
> like the "localization" mods to not be reflected in the "changed-or-not"
> status of the package.  That is, I think that I'd like to munge the MD5
> of various config files as part of post-install, to account for
> localizations.
> 
> Now, it seems to me having used RPM and monitored this list for some
> time, that even if this is possible it may violate the "spirit of RPM". 
> My sense is that RPM gurus tend to advocate for minimal %post-install
> activity, so that RPMs are harder to break and are therefore more
> flexible, and more easily reused in contexts such as yum. 
> 
> I'd appreciate comments both on the immediate problem and/or if/how
> "solving" it would violate the "spirit of RPM."  

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-----


[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