Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH v2] emerge: warn for --autounmask-continue with --autounmask=n (bug 619612)
Date: Tue, 30 May 2017 03:33:15
Message-Id: CAMiTYSqqVXW39C_cvFGZX52G53Ar+YELQ0X6KMMbvMa92yNL7g@mail.gmail.com
In Reply to: Re: [gentoo-portage-dev] [PATCH v2] emerge: warn for --autounmask-continue with --autounmask=n (bug 619612) by Brian Dolbec
1 On Mon, May 29, 2017 at 3:10 PM, Brian Dolbec <dolsen@g.o> wrote:
2
3 > On Mon, 29 May 2017 14:10:23 -0700
4 > Zac Medico <zmedico@g.o> wrote:
5 >
6 > > In order to avoid possible confusion when the user has specified
7 > > --autounmask-continue and EMERGE_DEFAULT_OPTS contains
8 > > --autounmask=n, display a warning message as follows:
9 > >
10 > > * --autounmask-continue has been disabled by --autounmask=n
11 > >
12 > > X-Gentoo-bug: 619612
13 > > X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=619612
14 > > ---
15 > > [PATCH v2] preserves previous behavior where --autounmask=n
16 > > overrides --autounmask-continue, as suggested by Alexander
17 > > Berntsen
18 > >
19 > > pym/_emerge/actions.py | 6 ++++++
20 > > pym/portage/tests/emerge/test_simple.py | 5 ++++-
21 > > 2 files changed, 10 insertions(+), 1 deletion(-)
22 > >
23 > > diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
24 > > index 1bc20c3ed..c8a62fb01 100644
25 > > --- a/pym/_emerge/actions.py
26 > > +++ b/pym/_emerge/actions.py
27 > > @@ -2862,6 +2862,12 @@ def run_action(emerge_config):
28 > > adjust_configs(emerge_config.opts, emerge_config.trees)
29 > > apply_priorities(emerge_config.target_config.settings)
30 > >
31 > > + if ("--autounmask-continue" in emerge_config.opts and
32 > > + emerge_config.opts.get("--autounmask") == "n"):
33 > > + writemsg_level(
34 > > + " %s --autounmask-continue has been disabled
35 > > by --autounmask=n\n" %
36 > > + warn("*"), level=logging.WARNING,
37 > > noiselevel=-1) +
38 > > for fmt in
39 > > emerge_config.target_config.settings.get("PORTAGE_BINPKG_FORMAT",
40 > > "").split(): if not fmt in portage.const.SUPPORTED_BINPKG_FORMATS: if
41 > > "--pkg-format" in emerge_config.opts: diff --git
42 > > a/pym/portage/tests/emerge/test_simple.py
43 > > b/pym/portage/tests/emerge/test_simple.py index 5930f6cc8..f99c77927
44 > > 100644 --- a/pym/portage/tests/emerge/test_simple.py +++
45 > > b/pym/portage/tests/emerge/test_simple.py @@ -311,7 +311,10 @@
46 > > pkg_preinst() { emerge_cmd + ("--unmerge", "--quiet", "dev-libs/A"),
47 > > emerge_cmd + ("-C", "--quiet", "dev-libs/B"),
48 > >
49 > > - emerge_cmd + ("--autounmask-continue",
50 > > "dev-libs/C",),
51 > > + # If EMERGE_DEFAULT_OPTS contains
52 > > --autounmask=n, then --autounmask
53 > > + # must be specified with
54 > > --autounmask-continue.
55 > > + ({"EMERGE_DEFAULT_OPTS" :
56 > > "--autounmask=n"},) + \
57 > > + emerge_cmd + ("--autounmask",
58 > > "--autounmask-continue", "dev-libs/C",), # Verify that the above
59 > > --autounmask-continue command caused # USE=flag to be applied
60 > > correctly to dev-libs/D. portageq_cmd + ("match", eroot,
61 > > "dev-libs/D[flag]"),
62 >
63 >
64 > WFM
65 >
66
67 Thanks, pushed:
68
69 https://gitweb.gentoo.org/proj/portage.git/commit/?id=565ceb1bebc83ec1a5572a672e2e08ea7d91e7a8
70
71 --
72 Thanks,
73 Zac