Gentoo Archives: gentoo-portage-dev

From: Mike Gilbert <floppym@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Mike Gilbert <floppym@g.o>
Subject: [gentoo-portage-dev] [PATCH] Revert "lib/_emerge/actions.py: warn on missing /run"
Date: Mon, 14 Feb 2022 20:37:11
Message-Id: 20220214203656.958618-1-floppym@gentoo.org
1 Portage itself does not need /run to be mounted.
2 build-docbook-catalog was adjusted to create locks in /etc/xml instead.
3
4 Bug: https://bugs.gentoo.org/832853
5 Closes: https://github.com/gentoo/portage/pull/788
6 Reverts: 0e9e12aadb889766d61c0561b9723e71542d43e6
7 Signed-off-by: Mike Gilbert <floppym@g.o>
8 ---
9 lib/_emerge/actions.py | 33 ++++++++++++---------------------
10 1 file changed, 12 insertions(+), 21 deletions(-)
11
12 diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
13 index 0255e3e97..f82069f9a 100644
14 --- a/lib/_emerge/actions.py
15 +++ b/lib/_emerge/actions.py
16 @@ -3020,25 +3020,17 @@ def validate_ebuild_environment(trees):
17 check_locale()
18
19
20 -def check_mounted_fs():
21 - """We need /proc for finding CPU counts and finding other system information.
22 - We need /run for e.g. lock files in ebuilds."""
23 - paths = {"/proc": False, "/run": False}
24 -
25 - for path in paths.keys():
26 - if platform.system() not in ("Linux",) or os.path.ismount(path):
27 - paths[path] = True
28 - continue
29 -
30 - msg = "It seems %s is not mounted. Process management may malfunction." % path
31 - writemsg_level(
32 - "".join("!!! %s\n" % l for l in textwrap.wrap(msg, 70)),
33 - level=logging.ERROR,
34 - noiselevel=-1,
35 - )
36 -
37 - # Were all of the mounts we were looking for available?
38 - return all(paths.values())
39 +def check_procfs():
40 + procfs_path = "/proc"
41 + if platform.system() not in ("Linux",) or os.path.ismount(procfs_path):
42 + return os.EX_OK
43 + msg = "It seems that %s is not mounted. You have been warned." % procfs_path
44 + writemsg_level(
45 + "".join("!!! %s\n" % l for l in textwrap.wrap(msg, 70)),
46 + level=logging.ERROR,
47 + noiselevel=-1,
48 + )
49 + return 1
50
51
52 def config_protect_check(trees):
53 @@ -3516,8 +3508,7 @@ def run_action(emerge_config):
54 repo_name_check(emerge_config.trees)
55 repo_name_duplicate_check(emerge_config.trees)
56 config_protect_check(emerge_config.trees)
57 -
58 - check_mounted_fs()
59 + check_procfs()
60
61 for mytrees in emerge_config.trees.values():
62 mydb = mytrees["porttree"].dbapi
63 --
64 2.35.1