Date: Sat, 9 Aug 2014 15:35:24 +0200 From: Tijl Coosemans <tijl@FreeBSD.org> To: Melvyn Sopacua <melvyn@magemana.nl> Cc: ports@FreeBSD.org, Baptiste Daroussin <bapt@FreeBSD.org> Subject: Re: How to tell pkg it's OK to overwrite files by another port Message-ID: <20140809153524.215a1663@kalimero.tijl.coosemans.org> In-Reply-To: <alpine.BSF.2.00.1408091414230.27232@fire.magemana.nl> References: <alpine.BSF.2.00.1408050528170.52235@fire.magemana.nl> <20140805143415.GD17537@ivaldir.etoilebsd.net> <alpine.BSF.2.00.1408062112220.72407@fire.magemana.nl> <20140806210759.GQ17537@ivaldir.etoilebsd.net> <alpine.BSF.2.00.1408091414230.27232@fire.magemana.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 9 Aug 2014 14:27:05 +0200 (CEST) Melvyn Sopacua wrote: > On Wed, 6 Aug 2014, Baptiste Daroussin wrote: >> On Wed, Aug 06, 2014 at 09:19:48PM +0200, Melvyn Sopacua wrote: >>> Both are candidates for myconfig.conf, where optimized should win and >>> otherwise default, but they come from two different ports. This may >>> actually be the way to handle it, if @sample didn't assume the same >>> basename. >> >> There is the @sample keyword for that ;) > > I don't think there is. > @sample foo.sample sets target_file to foo. There's no way to specify > that target_file should be bar. > If two ports have the same .sample file, there is still a conflict. So > in my case, I need two different .sample files installing to a shared > target_file. > > I think this is a corner case, so I'll stick it in a custom pkg-install. You can use @sample in the base port and in the optimized port you can replace the original config if it's still the same as the sample config. Something like this: @unexec if cmp -s %D/etc/foo.conf %D/etc/optimized.conf.sample; then cp %D/etc/foo.conf.sample %D/etc/foo.conf; fi etc/optimized.conf.sample @exec if cmp -s %D/etc/foo.conf %D/etc/foo.conf.sample; then cp %B/%f %B/foo.conf; fi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140809153524.215a1663>