Gentoo Archives: gentoo-dev

From: Ulrich Mueller <ulm@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] What commands are allowed in global scope of an ebuild?
Date: Mon, 30 Aug 2021 16:06:02
Message-Id: uzgsyudd1@gentoo.org
1 Quite a while ago, bug 520528 was filed, asking for a ban of
2 has_version, best_version, and possibly other commands in global scope.
3
4 Since most ebuild commands cannot be used in global scope anyway,
5 I think that a positive list of commands _allowed_ there would make more
6 sense; all other commands would be banned.
7
8 Discussing this in #gentoo-pms, we have identified the following
9 commands (from PMS section 12.3 [1]) that would be allowed:
10
11 - einfo, einfon, elog, ewarn, eqawarn, eerror, ebegin, eend
12 - has, hasv, hasq
13 - ver_cut, ver_rs, ver_test
14 - inherit, EXPORT_FUNCTIONS
15 - get_libdir
16 - debug-print, debug-print-function, debug-print-section
17 - die (this is a special case: calling die in global scope is an error)
18
19 Are there any others that I've missed, i.e. that are legitimately used
20 in global scope of ebuilds and eclasses?
21
22 Ulrich
23
24 [1] https://projects.gentoo.org/pms/8/pms.html#x1-12000012.3

Attachments

File name MIME type
signature.asc application/pgp-signature