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

Bug 440470

Summary: net-nds/openldap-2.4.30: some elog messages should only be shown for the first install.
Product: Gentoo Linux Reporter: poletti.marco
Component: Current packagesAssignee: Gentoo LDAP project <ldap-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: arfrever.fta
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 440214    

Description poletti.marco 2012-10-31 10:59:02 UTC
Disclaimer: this bug has been filed in a semi-automated manner.

When emerging the package net-nds/openldap-2.4.30, the following elog messages are displayed:

 * Getting started using OpenLDAP? There is some documentation available:
 * Gentoo Guide to OpenLDAP Authentication
 * (http://www.gentoo.org/doc/en/ldap-howto.xml)
 * ---
 * An example file for tuning BDB backends with openldap is
 * DB_CONFIG.fast.example in /usr/share/doc/openldap-2.4.30/

Such messages should only be displayed when the package is a new install.
These situations can be checked in the ebuild as follows:

if ! has_version 'net-nds/openldap'; then

See the tracker bug 440214 for more details.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-09-06 14:26:09 UTC
Also:

-      elog "Adding $(basename ${x})"
+      einfo "Adding $(basename ${x})"

Users do not need to see this after a successful build, only during (if at all).
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-10-12 06:12:02 UTC
What if it it built with USE=minimal, and then you are rebuilding with USE=-minimal, in that case, I want to display the message still, regardless of it being previously installed.
Comment 3 Arfrever Frehtes Taifersar Arahesis 2014-10-12 07:23:22 UTC
(In reply to Robin Johnson from comment #2)
> What if it it built with USE=minimal, and then you are rebuilding with
> USE=-minimal, in that case, I want to display the message still, regardless
> of it being previously installed.

Such check is possible in pkg_preinst(). You can save result to variable and check this variable in pkg_postinst().


pkg_preinst() {
    ! has_version net-nds/openldap || has_version "net-nds/openldap[minimal]"
    OPENLDAP_PRINT_MESSAGES=$((! $?))
}

pkg_postinst() {
    if ((${OPENLDAP_PRINT_MESSAGES})); then
        elog ...
    fi
}
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-10-13 21:46:16 UTC
thanks Arfrever, implemented now, with slight tweak