Re: [gentoo-portage-dev] [PATCH] depgraph: make --autounmask-continue imply --autounmask

2017-05-29 Thread Zac Medico
On Mon, May 29, 2017 at 4:03 AM, Alexander Berntsen 
wrote:

> Looks OK. Although I'm not a fan of the proposed change. Changes like
> these make scripts a tiny bit more tedious. If you have a bunch of
> --autounmask stuff in your script, you can now just do --autounmask=n
> and turn it all off. This means you'll have to turn off more stuff. And
> --autounmask-continue is supposed to be used "with great care" anyway,
> so I think it's fine to demand users to write --autounmask too.
>

Yeah, we can go the other way and make --autounmask=n trigger a warning
message when --autounmask-continue is also in the options. My main goal is
to prevent confusion in this case.
-- 
Thanks,
Zac


[gentoo-portage-dev] [PATCH] depgraph: make --autounmask-continue imply --autounmask

2017-05-28 Thread Zac Medico
This fixes conflicting behavior when EMERGE_DEFAULT_OPTS
contains --autounmask=n.

X-Gentoo-bug: 619612
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=619612
---
 pym/_emerge/depgraph.py | 3 +++
 pym/portage/tests/emerge/test_simple.py | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 726835dd4..92c519c6f 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -9463,6 +9463,9 @@ def backtrack_depgraph(settings, trees, myopts, myparams,
 
 def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, 
spinner):
 
+   if "--autounmask-continue" in myopts:
+   myopts["--autounmask"] = True
+
debug = "--debug" in myopts
mydepgraph = None
max_retries = myopts.get('--backtrack', 10)
diff --git a/pym/portage/tests/emerge/test_simple.py 
b/pym/portage/tests/emerge/test_simple.py
index 5930f6cc8..1114dc053 100644
--- a/pym/portage/tests/emerge/test_simple.py
+++ b/pym/portage/tests/emerge/test_simple.py
@@ -311,7 +311,8 @@ pkg_preinst() {
emerge_cmd + ("--unmerge", "--quiet", "dev-libs/A"),
emerge_cmd + ("-C", "--quiet", "dev-libs/B"),
 
-   emerge_cmd + ("--autounmask-continue", "dev-libs/C",),
+   # --autounmask-continue overrides --autounmask=n
+   emerge_cmd + ("--autounmask=n", 
"--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]"),
-- 
2.13.0