Gentoo Archives: gentoo-pms

From: Ulrich Mueller <ulm@g.o>
To: gentoo-pms@l.g.o
Subject: [gentoo-pms] Somewhat contradictory wording on global scope commands
Date: Tue, 29 Aug 2017 18:25:34
Message-Id: 22949.45463.345774.50766@a1i15.kph.uni-mainz.de
1 PMS section 11.3 "Available Commands"
2 https://projects.gentoo.org/pms/6/pms.html#x1-12600011.3 says:
3
4 | This section documents the commands available to an ebuild. Unless
5 | otherwise specified, they may be aliases, shell functions, or
6 | executables in the ebuild's PATH.
7 |
8 | When an ebuild is being sourced for metadata querying rather than
9 | for a build (that is to say, when none of the src_ or pkg_ functions
10 | are to be called), no external command may be executed. The package
11 | manager may take steps to enforce this.
12
13 So ebuilds must not execute external commands in global scope.
14
15 However, in section 11.3.3 "Ebuild-specific commands" we have:
16
17 | The following commands will always be available in the ebuild
18 | environment, provided by the package manager.
19
20 "Always" means that they are available in global scope too?
21
22 | Except where otherwise noted, they may be internal (shell functions
23 | or aliases) or external commands available in PATH; where this is
24 | not specified, ebuilds may not rely upon either behaviour.
25
26 If they can be external commands, then by 11.3 ebuilds must not call
27 them in global scope, and the PM may even enforce this?
28
29 All in all, this is somewhat contradictory, and I wonder if we
30 shouldn't say in 11.3.3 instead that ebuild must not call any of these
31 commands in global scope, unless this is explicitly permitted.
32
33 (The next question is of course which commands qualify for global
34 scope usage?)
35
36 Ulrich