1 |
In order to avoid possible confusion when the user has specified |
2 |
--autounmask-continue and EMERGE_DEFAULT_OPTS contains |
3 |
--autounmask=n, display a warning message as follows: |
4 |
|
5 |
* --autounmask-continue has been disabled by --autounmask=n |
6 |
|
7 |
X-Gentoo-bug: 619612 |
8 |
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=619612 |
9 |
--- |
10 |
[PATCH v2] preserves previous behavior where --autounmask=n |
11 |
overrides --autounmask-continue, as suggested by Alexander |
12 |
Berntsen |
13 |
|
14 |
pym/_emerge/actions.py | 6 ++++++ |
15 |
pym/portage/tests/emerge/test_simple.py | 5 ++++- |
16 |
2 files changed, 10 insertions(+), 1 deletion(-) |
17 |
|
18 |
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py |
19 |
index 1bc20c3ed..c8a62fb01 100644 |
20 |
--- a/pym/_emerge/actions.py |
21 |
+++ b/pym/_emerge/actions.py |
22 |
@@ -2862,6 +2862,12 @@ def run_action(emerge_config): |
23 |
adjust_configs(emerge_config.opts, emerge_config.trees) |
24 |
apply_priorities(emerge_config.target_config.settings) |
25 |
|
26 |
+ if ("--autounmask-continue" in emerge_config.opts and |
27 |
+ emerge_config.opts.get("--autounmask") == "n"): |
28 |
+ writemsg_level( |
29 |
+ " %s --autounmask-continue has been disabled by --autounmask=n\n" % |
30 |
+ warn("*"), level=logging.WARNING, noiselevel=-1) |
31 |
+ |
32 |
for fmt in emerge_config.target_config.settings.get("PORTAGE_BINPKG_FORMAT", "").split(): |
33 |
if not fmt in portage.const.SUPPORTED_BINPKG_FORMATS: |
34 |
if "--pkg-format" in emerge_config.opts: |
35 |
diff --git a/pym/portage/tests/emerge/test_simple.py b/pym/portage/tests/emerge/test_simple.py |
36 |
index 5930f6cc8..f99c77927 100644 |
37 |
--- a/pym/portage/tests/emerge/test_simple.py |
38 |
+++ b/pym/portage/tests/emerge/test_simple.py |
39 |
@@ -311,7 +311,10 @@ pkg_preinst() { |
40 |
emerge_cmd + ("--unmerge", "--quiet", "dev-libs/A"), |
41 |
emerge_cmd + ("-C", "--quiet", "dev-libs/B"), |
42 |
|
43 |
- emerge_cmd + ("--autounmask-continue", "dev-libs/C",), |
44 |
+ # If EMERGE_DEFAULT_OPTS contains --autounmask=n, then --autounmask |
45 |
+ # must be specified with --autounmask-continue. |
46 |
+ ({"EMERGE_DEFAULT_OPTS" : "--autounmask=n"},) + \ |
47 |
+ emerge_cmd + ("--autounmask", "--autounmask-continue", "dev-libs/C",), |
48 |
# Verify that the above --autounmask-continue command caused |
49 |
# USE=flag to be applied correctly to dev-libs/D. |
50 |
portageq_cmd + ("match", eroot, "dev-libs/D[flag]"), |
51 |
-- |
52 |
2.13.0 |