Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 520528 - Ban use of meaningless helper functions in global scope
Summary: Ban use of meaningless helper functions in global scope
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PMS/EAPI
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-22 11:55 UTC by Michał Górny
Modified: 2021-09-03 06:56 UTC (History)
2 users (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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-08-22 11:55:15 UTC
AFAICS PMS only bans use* functions in global scope. However, we should also ban has_version and best_version. Build and installation functions are not really meaningful in global scope, so we could ban them as well.
Comment 1 Larry the Git Cow gentoo-dev 2021-09-03 06:56:06 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/pms.git/commit/?id=153324136107543ef07b1378f08bce81199a9022

commit 153324136107543ef07b1378f08bce81199a9022
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2021-08-30 19:32:16 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2021-08-31 16:05:50 +0000

    pkg-mgr-commands.tex: Clarify which commands are allowed in global scope
    
    For most commands this is already implied by the combination of the
    statements "When an ebuild is being sourced for metadata querying
    rather than for a build [...], no external command may be executed."
    in chapter 12 ("Available Commands") and "Except where otherwise
    noted, they may be internal [...] or external commands available in
    PATH; where this is not specified, ebuilds may not rely upon either
    behaviour." in section 12.3 ("Ebuild-specific Commands").
    
    For output commands (einfo etc.) and debug commands (debug-print etc.)
    to be allowed in global scope, they must be implemented as shell
    functions. Specify this, which follows the implementation in all three
    package managers.
    
    Closes: https://bugs.gentoo.org/520528
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 pkg-mgr-commands.tex | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)