Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 496150

Summary: sys-apps/man-db: use REQUIRED_USE for berkdb/gdbm selection
Product: Gentoo Linux Reporter: Sergey Popov <pinkbyte>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: trivial    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=697796
Whiteboard:
Package list:
Runtime testing required: ---

Description Sergey Popov gentoo-dev 2013-12-27 10:47:23 UTC
In short: it links to sys-libs/gdbm in two cases:

USE="-berkdb gdbm" (right)
USE="-berkdb -gdbm" (wrong)

More important - i does not throw any message that gdbm will be used when both flags are disabled. I suggest to utilize REQUIRES_USE here, for example:

REQUIRED_USE="|| ( berkdb gdbm )"

and make gdbm USE-flag default one.
Comment 1 Sergey Popov gentoo-dev 2013-12-27 10:51:36 UTC
Oh, sorry, REQUIRED_USE syntax should be 'exactly one of' in this case:

REQUIRED_USE="^^ ( berkdb gdbm )"

Cause man-db could be linked only with one of those libraries.

berkdb is not enabled in profiles globally(while gdbm is, in releases/), so defaulting to it properly would be good choice.
Comment 2 SpanKY gentoo-dev 2013-12-27 20:27:32 UTC
i specifically did not utilize REQUIRED_USE.  first because the ebuild was EAPI=2, and then later because it's annoying.  if you enable berkdb or gdbm, then things work as expected.  if you happen to have both or neither enabled, then the ebuild will pick a sane default for you.  users most likely don't give two s**ts what happens here.
Comment 3 Sergey Popov gentoo-dev 2013-12-27 20:41:09 UTC
(In reply to SpanKY from comment #2)
> i specifically did not utilize REQUIRED_USE.  first because the ebuild was
> EAPI=2, and then later because it's annoying.  if you enable berkdb or gdbm,
> then things work as expected.  if you happen to have both or neither
> enabled, then the ebuild will pick a sane default for you.  users most
> likely don't give two s**ts what happens here.

Well, problem is, that when both of flags are disabled(or enabled) there can be false assumption made by user that neither of that libs needed.

However, if you are still strongly against implementing REQUIRED_USE logic, i think we could deal with simple einfo(ewarn/elog?) message, warning user about which sane default is chosen in corner cases.
Comment 4 SpanKY gentoo-dev 2013-12-27 23:06:50 UTC
(In reply to Sergey Popov from comment #3)

i have no problem adding an ewarn in like pkg_setup when it's ambiguous (both enabled or both disabled)
Comment 5 SpanKY gentoo-dev 2014-01-18 02:36:32 UTC
should be all set now in the tree; thanks for the report!

Commit message: Add warning when USE flags are ambiguous
http://sources.gentoo.org/sys-apps/man-db/man-db-2.6.5.ebuild?r1=1.8&r2=1.9