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

Bug 697796

Summary: sys-apps/man-db should use REQUIRED_USE to explicitly depend only on sys-libs/db or on sys-libs/gdbm
Product: Gentoo Linux Reporter: Bertrand Jacquin <bertrand>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: bertrand, dan, opal, sam
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/13263
https://bugs.gentoo.org/show_bug.cgi?id=496150
Whiteboard:
Package list:
Runtime testing required: ---

Description Bertrand Jacquin 2019-10-15 21:02:24 UTC
sys-apps/man-db has 2 USE flags that can be used to specify the database engine to use, berkdb or gdbm. Both have dynamic dependency that influence the dependency tree. If none is explicitly set in the USE flag list, gdbm is used as a fallback.

REQUIRED_USE is supported since EAPI 4 and offer the ability to explicitly require a USE flag to be enabled. berkdb is enabled by default in profiles/default/linux/make.defaults while gdbm is enabled by default in no profile.

https://github.com/gentoo/gentoo/pull/13263 removes the warning made in pkg_setup and defer berkdb vs gdbm USE flag handling to the package manager. This change also move the default to berkdb to align with defaults in profile.


Reproducible: Always
Comment 1 Lars Wendler (Polynomial-C) gentoo-dev 2019-10-16 08:13:59 UTC
I do not really understand what you are trying to solve here. Using REQUIRED_USE here could interrupt emerge runs while using a sane fallback does not.
Comment 2 Bertrand Jacquin 2019-10-16 22:32:45 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #1)
> I do not really understand what you are trying to solve here. Using
> REQUIRED_USE here could interrupt emerge runs while using a sane fallback
> does not.

REQUIRED_USE does not interrupt while it runs, it interrupts the dependency tree calculation.

berkdb being enabled by default in profiles/default/linux/make.defaults and gdbm being not enable by default, the only package requiring gdbm becomes man-db, without an explicit choice made by the user.
Comment 3 Arfrever Frehtes Taifersar Arahesis 2019-10-22 08:01:15 UTC
I think that REQUIRED_USE="^^ ( berkdb gdbm )" is a good idea.


(In reply to Bertrand Jacquin from comment #0)
> This change also move the default to berkdb to align with defaults in
> profile.

This is rather bad idea, since >=sys-libs/db-6 has potentially problematic license.
sys-libs/gdbm has no problems with license.
So I suggest to continue defaulting to USE="gdbm".


It would be better if berkdb was dropped from profiles/default/linux/make.defaults and added to profiles/default/linux/package.use for only these packages where enabling it by default makes sense, but until such changes happen, profiles/default/linux/package.use could have this entry:
sys-apps/man-db -berkdb
Comment 4 Bertrand Jacquin 2019-10-22 20:54:42 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #3)
> I think that REQUIRED_USE="^^ ( berkdb gdbm )" is a good idea.
> 
> 
> (In reply to Bertrand Jacquin from comment #0)
> > This change also move the default to berkdb to align with defaults in
> > profile.
> 
> This is rather bad idea, since >=sys-libs/db-6 has potentially problematic
> license.
> sys-libs/gdbm has no problems with license.
> So I suggest to continue defaulting to USE="gdbm".
> 
> It would be better if berkdb was dropped from
> profiles/default/linux/make.defaults and added to
> profiles/default/linux/package.use for only these packages where enabling it
> by default makes sense, but until such changes happen,
> profiles/default/linux/package.use could have this entry:
> sys-apps/man-db -berkdb

Yeah, changing the default db from berkdb to gdbm seems fine to me as long there is no automagic dependencies coming into play.

Do you want me to provide a patch to address this ?
Comment 5 jospezial 2020-03-29 02:09:06 UTC
strange dependency output for man-db:

equery d gdbm
 * These packages depend on gdbm:
dev-lang/perl-5.30.1 (gdbm ? >=sys-libs/gdbm-1.8.3)
dev-lang/python-2.7.17-r1 (gdbm ? sys-libs/gdbm[berkdb])
dev-lang/python-3.7.7 (gdbm ? sys-libs/gdbm[berkdb])
dev-lang/python-3.8.2 (gdbm ? sys-libs/gdbm[berkdb])
dev-lang/ruby-2.6.5 (gdbm ? sys-libs/gdbm)
dev-lang/ruby-2.7.0 (gdbm ? sys-libs/gdbm)
dev-libs/apr-util-1.6.1-r3 (gdbm ? sys-libs/gdbm)
media-sound/pulseaudio-13.99.1 (gdbm ? sys-libs/gdbm)
sys-apps/man-db-2.9.1 (gdbm ? sys-libs/gdbm)
                      (!gdbm ? sys-libs/gdbm)
Comment 6 Larry the Git Cow gentoo-dev 2022-02-07 02:08:06 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4fed9a6d9b0ae81fff6b7a7390fea76e8e59d826

commit 4fed9a6d9b0ae81fff6b7a7390fea76e8e59d826
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-02-07 01:51:11 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-02-07 02:07:53 +0000

    sys-apps/man-db: add 2.10.0
    
    Now defaults to gdbm, but can use berkdb to switch back to that
    instead if desired.
    
    This doesn't change the default for anybody as USE="+gdbm" has
    been in profiles for a long time and we dropped USE="+berkdb" in profiles
    a while ago. Plus, when in doubt, the ebuild used to go for USE=gdbm when
    both were set. So, this is just a cleanup of the existing logic.
    
    Closes: https://bugs.gentoo.org/830565
    Closes: https://bugs.gentoo.org/697796
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/man-db/Manifest                           |   1 +
 .../files/man-db-2.10.0-fix-build-clang.patch      |  44 +++++
 .../files/man-db-2.9.3-darwin-libdb-intl.patch     |   2 +
 sys-apps/man-db/man-db-2.10.0.ebuild               | 196 +++++++++++++++++++++
 sys-apps/man-db/man-db-9999.ebuild                 |  67 ++++---
 5 files changed, 273 insertions(+), 37 deletions(-)