1 |
Automatic CCACHE_DIR permission adjustments can cause problems for |
2 |
some users, therefore add a FEATURES flag so that it can be disabled. |
3 |
|
4 |
Bug: https://bugs.gentoo.org/657582 |
5 |
Signed-off-by: Zac Medico <zmedico@g.o> |
6 |
--- |
7 |
cnf/make.globals | 1 + |
8 |
lib/portage/const.py | 1 + |
9 |
lib/portage/package/ebuild/prepare_build_dirs.py | 4 +++- |
10 |
man/make.conf.5 | 4 ++++ |
11 |
4 files changed, 9 insertions(+), 1 deletion(-) |
12 |
|
13 |
diff --git a/cnf/make.globals b/cnf/make.globals |
14 |
index d394a1890..2e988da68 100644 |
15 |
--- a/cnf/make.globals |
16 |
+++ b/cnf/make.globals |
17 |
@@ -51,6 +51,7 @@ FETCHCOMMAND_SFTP="bash -c \"x=\\\${2#sftp://} ; host=\\\${x%%/*} ; port=\\\${ho |
18 |
|
19 |
# Default user options |
20 |
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs |
21 |
+ ccache-permission-adjust |
22 |
config-protect-if-modified distlocks ebuild-locks |
23 |
fixlafiles merge-sync multilib-strict news |
24 |
parallel-fetch preserve-libs protect-owned |
25 |
diff --git a/lib/portage/const.py b/lib/portage/const.py |
26 |
index edbfb9f17..e6d097c65 100644 |
27 |
--- a/lib/portage/const.py |
28 |
+++ b/lib/portage/const.py |
29 |
@@ -132,6 +132,7 @@ SUPPORTED_FEATURES = frozenset([ |
30 |
"candy", |
31 |
"case-insensitive-fs", |
32 |
"ccache", |
33 |
+ "ccache-permission-adjust", |
34 |
"cgroup", |
35 |
"chflags", |
36 |
"clean-logs", |
37 |
diff --git a/lib/portage/package/ebuild/prepare_build_dirs.py b/lib/portage/package/ebuild/prepare_build_dirs.py |
38 |
index e53ccd0fb..a37c67839 100644 |
39 |
--- a/lib/portage/package/ebuild/prepare_build_dirs.py |
40 |
+++ b/lib/portage/package/ebuild/prepare_build_dirs.py |
41 |
@@ -157,10 +157,12 @@ def _prepare_features_dirs(mysettings): |
42 |
|
43 |
features_dirs = { |
44 |
"ccache":{ |
45 |
+ "adjust": "ccache-permission-adjust" in mysettings.features, |
46 |
"basedir_var":"CCACHE_DIR", |
47 |
"default_dir":os.path.join(mysettings["PORTAGE_TMPDIR"], "ccache"), |
48 |
"always_recurse":False}, |
49 |
"distcc":{ |
50 |
+ "adjust": True, |
51 |
"basedir_var":"DISTCC_DIR", |
52 |
"default_dir":os.path.join(mysettings["BUILD_PREFIX"], ".distcc"), |
53 |
"subdirs":("lock", "state"), |
54 |
@@ -174,7 +176,7 @@ def _prepare_features_dirs(mysettings): |
55 |
"userpriv" in mysettings.features and \ |
56 |
"userpriv" not in restrict |
57 |
for myfeature, kwargs in features_dirs.items(): |
58 |
- if myfeature in mysettings.features: |
59 |
+ if myfeature in mysettings.features and kwargs['adjust']: |
60 |
failure = False |
61 |
basedir = mysettings.get(kwargs["basedir_var"]) |
62 |
if basedir is None or not basedir.strip(): |
63 |
diff --git a/man/make.conf.5 b/man/make.conf.5 |
64 |
index de04e5e34..4bd26713a 100644 |
65 |
--- a/man/make.conf.5 |
66 |
+++ b/man/make.conf.5 |
67 |
@@ -350,6 +350,10 @@ like "File not recognized: File truncated"), try recompiling the application |
68 |
with ccache disabled before reporting a bug. Unless you are doing development |
69 |
work, do not enable ccache. |
70 |
.TP |
71 |
+.B ccache\-permission\-adjust |
72 |
+Enable automatic permission adjustment for \fBCCACHE_DIR\fR when |
73 |
+FEATURES=\fBccache\fR is enabled. This feature is enabled by default. |
74 |
+.TP |
75 |
.B cgroup |
76 |
Use Linux control group to control processes spawned by ebuilds. This allows |
77 |
emerge to safely kill all subprocesses when ebuild phase exits. |
78 |
-- |
79 |
2.18.1 |