From owner-freebsd-ports@freebsd.org Tue Mar 27 13:23:11 2018 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24D0FF52854 for ; Tue, 27 Mar 2018 13:23:11 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.117.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AC01484ABA for ; Tue, 27 Mar 2018 13:23:10 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from leaf.local (unknown [88.202.132.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id 4D5B632D3 for ; Tue, 27 Mar 2018 13:23:03 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/4D5B632D3; dkim=none; dkim-atps=neutral Subject: Re: Two pkg(8) repo configs pointing to same repo To: freebsd-ports@freebsd.org References: <1f9c9001-a6fa-55aa-2362-2b80d597b18f@yahoo.com> From: Matthew Seaman Message-ID: <1058c8ba-ea67-da67-29a5-19f71ec8b31c@FreeBSD.org> Date: Tue, 27 Mar 2018 14:23:02 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1f9c9001-a6fa-55aa-2362-2b80d597b18f@yahoo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Mar 2018 13:23:11 -0000 On 27/03/2018 13:56, Anthony Jenkins via freebsd-ports wrote: > Is there a way to configure a pkg(8) repo such that it has multiple ways > to refer to the same physical repository?  I'm picturing the "url:" > parameter being either a string or a list of strings: > That isn't possible with pkg(8) at the moment. However, you don't need to change pkg(8) to achieve the effect you want. You can have multiple repo.conf files enabled at the same time, so long as you make sure the tag is different between the two files. pkg(8) will complain about being unable to contact one or other of the two, but I believe it should be capable of using just the server it can contact. Failing that, you will need to take control of the DNS inside your home network, so you can make your server name resolve to whatever is correct depending on where you are. Possibly you could just create an A record that resolves to the two different IPs, but I'm not sure how well pkg(8) handles that if one of the IPs is unreachable. Cheers, Matthew