commit:     565ceb1bebc83ec1a5572a672e2e08ea7d91e7a8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun May 28 08:55:27 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May 30 03:30:50 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=565ceb1b

emerge: warn for --autounmask-continue with --autounmask=n (bug 619612)

In order to avoid possible confusion when the user has specified
--autounmask-continue and EMERGE_DEFAULT_OPTS contains
--autounmask=n, display a warning message as follows:

 * --autounmask-continue has been disabled by --autounmask=n

X-Gentoo-bug: 619612
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=619612
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/actions.py                  | 6 ++++++
 pym/portage/tests/emerge/test_simple.py | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 1bc20c3ed..c8a62fb01 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2862,6 +2862,12 @@ def run_action(emerge_config):
        adjust_configs(emerge_config.opts, emerge_config.trees)
        apply_priorities(emerge_config.target_config.settings)
 
+       if ("--autounmask-continue" in emerge_config.opts and
+               emerge_config.opts.get("--autounmask") == "n"):
+               writemsg_level(
+                       " %s --autounmask-continue has been disabled by 
--autounmask=n\n" %
+                       warn("*"), level=logging.WARNING, noiselevel=-1)
+
        for fmt in 
emerge_config.target_config.settings.get("PORTAGE_BINPKG_FORMAT", "").split():
                if not fmt in portage.const.SUPPORTED_BINPKG_FORMATS:
                        if "--pkg-format" in emerge_config.opts:

diff --git a/pym/portage/tests/emerge/test_simple.py 
b/pym/portage/tests/emerge/test_simple.py
index 5930f6cc8..f99c77927 100644
--- a/pym/portage/tests/emerge/test_simple.py
+++ b/pym/portage/tests/emerge/test_simple.py
@@ -311,7 +311,10 @@ pkg_preinst() {
                        emerge_cmd + ("--unmerge", "--quiet", "dev-libs/A"),
                        emerge_cmd + ("-C", "--quiet", "dev-libs/B"),
 
-                       emerge_cmd + ("--autounmask-continue", "dev-libs/C",),
+                       # If EMERGE_DEFAULT_OPTS contains --autounmask=n, then 
--autounmask
+                       # must be specified with --autounmask-continue.
+                       ({"EMERGE_DEFAULT_OPTS" : "--autounmask=n"},) + \
+                               emerge_cmd + ("--autounmask", 
"--autounmask-continue", "dev-libs/C",),
                        # Verify that the above --autounmask-continue command 
caused
                        # USE=flag to be applied correctly to dev-libs/D.
                        portageq_cmd + ("match", eroot, "dev-libs/D[flag]"),

Reply via email to