Michał Górny schrieb:
> Dnia 2014-06-11, o godz. 15:30:26
> Chí-Thanh Christopher Nguyễn <chith...@gentoo.org> napisał(a):
>
>>> 3. There is no clean way of enforcing SSL provider match between
>>> packages. Wasn't this thread initially about curl and rtmpdump
>>> requiring matching flags?
>> It could be enforced if an eclass does the actual choice of crypto
>> provider in a reproducible way. That would be not trivial though.
> No, it can't. Let's say package A depends on package B and requires
> the same SSL provider.
>
> A has 'openssl gnutls'
> B has 'openssl gnutls polarssl'
>
> Now let's say the eclass prefers polarssl over the other two. How are
> you going to make A dep on B?
>

It is not trivial, but I don't think it is impossible. I had thought of
the following, but have not carefully checked that it covers all cases.

crypto-providers.eclass would have a list CRYPTO_PROVIDERS_SUPPORTED
sorted descending by priority, and A and B would pass in a variable
CRYPTO_PROVIDERS the acceptable providers. The eclass would provide
functions which expand into USE dependencies to ensure that no
higher-prioritized crypto provider is selected in B.

Example:

crypto-providers.eclass:

CRYPTO_PROVIDERS_SUPPORTED="polarssl openssl gnutls libgcrypt libnettle ..."

crypto-providers_only() returns USE dependency on its arguments, and
negative USE dependencies for all providers with higher priority, e.g.
crypto-providers_only(gnutls) returns "-crypto_providers_polarssl(-)
-crypto_providers_openssl(-) crypto_providers_gnutls(-)"

crypto-providers_match(packagename) returns priority nested USE
conditionals for all CRYPTO_PROVIDERS that can be fed into DEPEND, e.g.
crypto_providers_match(B) would return "crypto-providers_openssl? (
B[$(crypto_providers-only(openssl)] )
!crypto-providers_openssl? ( crypto-providers_gnutls? (
B[$(crypto_providers-only(gnutls)] ) )"


A.ebuild
CRYPTO_PROVIDERS="openssl gnutls"
DEPEND="$(crypto-providers_match(B))"


B.ebuild
CRYPTO_PROVIDERS="openssl gnutls polarssl"



Best regards,
Chí-Thanh Christopher Nguyễn


Reply via email to