Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Feb 2007 14:56:39 +0100
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        Fabian Keil <freebsd-listen@fabiankeil.de>
Cc:        ports@FreeBSD.org
Subject:   Re: Optionally depending on one of two ports (or none of them)
Message-ID:  <45DDA117.3050508@FreeBSD.org>
In-Reply-To: <20070222141301.007fee4f@localhost>
References:  <20070222141301.007fee4f@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45DDA117.3050508>