From owner-freebsd-ports@FreeBSD.ORG Sat Aug 9 13:36:36 2014 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89299474; Sat, 9 Aug 2014 13:36:36 +0000 (UTC) Received: from mailrelay006.isp.belgacom.be (mailrelay006.isp.belgacom.be [195.238.6.172]) by mx1.freebsd.org (Postfix) with ESMTP id 00A252A85; Sat, 9 Aug 2014 13:36:35 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Al8GAE8j5lNbsLba/2dsb2JhbABZgw3SZ4MbAYEGF3eEBAEFOhwjEAsYCSUPKh4GMYgoAcUXF49MB4RMAQScLpR8g147 Received: from 218.182-176-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.176.182.218]) by relay.skynet.be with ESMTP; 09 Aug 2014 15:35:25 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.9/8.14.9) with ESMTP id s79DZOB3002207; Sat, 9 Aug 2014 15:35:24 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Sat, 9 Aug 2014 15:35:24 +0200 From: Tijl Coosemans To: Melvyn Sopacua 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: References: <20140805143415.GD17537@ivaldir.etoilebsd.net> <20140806210759.GQ17537@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: ports@FreeBSD.org, Baptiste Daroussin X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2014 13:36:36 -0000 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