Re: Should packages really own their config files???

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

 



On Mon, Sep 04, 2006 at 02:55:25PM +0100, Joe Orton wrote:
> On Mon, Sep 04, 2006 at 03:47:43PM +0200, Axel Thimm wrote:
> > On Mon, Sep 04, 2006 at 02:40:16PM +0100, Joe Orton wrote:
> > > On Sun, Sep 03, 2006 at 08:45:06PM -0500, Tom 'spot' Callaway wrote:
> > > > I'd be interested in seeing examples of cases where creating files in 
> > > > %post that are not owned by %files would be wanted. I can't think of
> > > > any.
> > > 
> > > With httpd we auto-generate a unique SSL certificate in %post 
> > > (/etc/pki/tls/localhost.crt et al; some other packages are similar 
> > > IIRC).  I don't think it would be correct to have those generated files 
> > > %files-owned by the package in any way.
> > 
> > I wouldn't consider certificates config files anyway. although one
> > should think about ownership over them, too. What's wrong with
> > %ghost %config(noreplace) them? Upgrades won't touch them.
> 
> I don't know how a ghosted noreplace file would be handled actually.  
> Would an --erase always remove such a file?  That is not really 
> desirable.

I'm not sure, if it does, then don't %ghost it. The drawback of not
ghosting would be a phony empty /etc/pki/tls/localhost.crt.rpmnew. But
this could be removed in the same %post operation that generates the
contents for /etc/pki/tls/localhost.crt.

E.g.

%install
...
touch %{buildroot}%{mycert}
...


%post
rm -f %{mycert}.rpmnew
if ...
  ... > %{mycert}
fi

%files
...
%config(noreplace) %{mycert}

-- 
Axel.Thimm at ATrpms.net

Attachment: pgpPZrAYU3wdj.pgp
Description: PGP signature

--
Fedora-packaging mailing list
Fedora-packaging@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-packaging

[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux