Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 440470 - net-nds/openldap-2.4.30: some elog messages should only be shown for the first install.
Summary: net-nds/openldap-2.4.30: some elog messages should only be shown for the firs...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo LDAP project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: first-time-messages
  Show dependency tree
 
Reported: 2012-10-31 10:59 UTC by poletti.marco
Modified: 2014-10-13 21:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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