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

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

 



Thanks very much.  Along with others, your response confirms that
cleverness is required as the capability I need is definitely not
provided by RPM itself, which does nevertheless provide enough hooks to
work around the issue.  The %verify override idea was a particularly
nice touch.

Adam

On Thu, 2005-07-07 at 23:10, Bob Proulx wrote:
> Adam Welch wrote:
> > Rodrigo Barbosa wrote:
> > > 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
> > > ...
> > > 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.
> 
> > 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).  
> 
> What I would recommend is mostly similar but slightly different.  You
> don't have to include the /etc/ config file in your rpm package.
> Manage it similarly to suggested above but not in your %files section
> at all.  Remove it in %postun and %preun.  Not being part of your
> package means that it can't fail verify.  The only thing you lose is
> the 'rpm -qf /etc/file' ability.
> 
> I have packaged files like this.  I keep the pristine package version
> in my /usr/share/doc/package/default-config directory.  (Not
> completely sure this is fully FHS compliant since /usr/share/doc is
> optional..)  In the %preun script check if they have been modified by
> comparing them to the pristine copies and handle that apropriately.
> 
> In that case you should create your own %verify script to verify the
> contents of the files not listed in %files.
> 
> Bob
> 
> _______________________________________________
> 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