From owner-freebsd-ports@FreeBSD.ORG Thu Feb 22 14:19:15 2007 Return-Path: X-Original-To: ports@FreeBSD.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8417916A401 for ; Thu, 22 Feb 2007 14:19:15 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.t-hosting.hu (server.t-hosting.hu [217.20.133.7]) by mx1.freebsd.org (Postfix) with ESMTP id 3908613C481 for ; Thu, 22 Feb 2007 14:19:15 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by server.t-hosting.hu (Postfix) with ESMTP id 2647B9EEA8F; Thu, 22 Feb 2007 14:56:59 +0100 (CET) X-Virus-Scanned: amavisd-new at t-hosting.hu Received: from server.t-hosting.hu ([127.0.0.1]) by localhost (server.t-hosting.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id VMW-P8frdrK4; Thu, 22 Feb 2007 14:56:45 +0100 (CET) Received: from [192.168.2.186] (catv-50635cb6.catv.broadband.hu [80.99.92.182]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.t-hosting.hu (Postfix) with ESMTP id E74199EEA85; Thu, 22 Feb 2007 14:56:44 +0100 (CET) Message-ID: <45DDA117.3050508@FreeBSD.org> Date: Thu, 22 Feb 2007 14:56:39 +0100 From: Gabor Kovesdan User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: Fabian Keil References: <20070222141301.007fee4f@localhost> In-Reply-To: <20070222141301.007fee4f@localhost> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: ports@FreeBSD.org Subject: Re: Optionally depending on one of two ports (or none of them) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Feb 2007 14:19:15 -0000 Fabian Keil schrieb: > I maintain the ports security/dns-proxy-tor and > security/trans-proxy-tor which both require a Tor > control port being available somewhere to do their job. > > They can work with both Tor versions in the ports collection > (security/tor and security/tor-devel), and I originally wanted > to register a dependency on the one that is already installed, > or use tor-devel if no version is installed. > > To do that I added the RUN_DEPENDS line: > > ${LOCALBASE}/bin/tor:${PORTSDIR}/security/tor-devel > > which mostly works as expected, but fails if the tor > port is installed, in which case a dependency on tor-devel > is registered. > > I'm aware that my RUN_DEPENDS line is incorrect, > but I'm unaware of a better way. > > Also by now my goal has been slightly changed and I want > to give the user the choice to either use one of the Tor > ports, or on none (if Tor is running on a remote system or > in another jail). > > The easiest solution is to not register any > dependencies and to simply print a pkg-message > to inform the user about his choices, but I was > wondering if there is a better way (that doesn't > involve shell scripts)? > > Simply adding OPTIONS is not an option (harhar) because > it wouldn't prevent the user from choosing the > wrong Tor port (the Tor ports use identical pkg-plists). > > What about grepping in the output of pkg_info? Or even better just grepping in ls ${PKG_DBDIR} to determine which one is installed and adding the appropriate dependency. Gabor