Gentoo Archives: gentoo-portage-dev

From: Lucian Poston <lucian.poston@×××××.com>
To: gentoo-portage-dev@l.g.o
Cc: bernalex@g.o, Lucian Poston <lucian.poston@×××××.com>
Subject: [gentoo-portage-dev] [PATCH v3] emerge: Add --autounmask-only parameter (bug 570672)
Date: Sat, 02 Jan 2016 23:05:22
Message-Id: 1451775928-26159-1-git-send-email-lucian.poston@gmail.com
In Reply to: [gentoo-portage-dev] [PATCH] emerge: Add --autounmask-only parameter by Lucian Poston
1 The --autounmask-only parameter will display autounmask messages,
2 perform autounmasking (in accordance with the other --autounmask-*
3 parameters), and exit with success (return value 0).
4
5 X-Gentoo-Bug: 570672
6 X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=570672
7 ---
8 man/emerge.1 | 6 ++++++
9 pym/_emerge/actions.py | 4 ++++
10 pym/_emerge/main.py | 11 +++++++++++
11 3 files changed, 21 insertions(+)
12
13 diff --git a/man/emerge.1 b/man/emerge.1
14 index c03f044..05b2a01 100644
15 --- a/man/emerge.1
16 +++ b/man/emerge.1
17 @@ -361,6 +361,12 @@ the specified configuration file(s), or enable the
18 \fBEMERGE_DEFAULT_OPTS\fR variable may be used to
19 disable this option by default in \fBmake.conf\fR(5).
20 .TP
21 +.BR "\-\-autounmask\-only [ y | n ]"
22 +Instead of doing any package building, just unmask
23 +packages and generate package.use settings as necessary
24 +to satisfy dependencies. This option is disabled by
25 +default.
26 +.TP
27 .BR "\-\-autounmask\-unrestricted\-atoms [ y | n ]"
28 If \-\-autounmask is enabled, keyword and mask changes
29 using the \'=\' operator will be written. With this
30 diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
31 index a080ba4..1c59abd 100644
32 --- a/pym/_emerge/actions.py
33 +++ b/pym/_emerge/actions.py
34 @@ -327,6 +327,10 @@ def action_build(settings, trees, mtimedb,
35 display_missing_pkg_set(root_config, e.value)
36 return 1
37
38 + if "--autounmask-only" in myopts:
39 + mydepgraph.display_problems()
40 + return 0
41 +
42 if not success:
43 mydepgraph.display_problems()
44 return 1
45 diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
46 index 5a8b93c..5dbafee 100644
47 --- a/pym/_emerge/main.py
48 +++ b/pym/_emerge/main.py
49 @@ -127,6 +127,7 @@ def insert_optional_args(args):
50 '--alert' : y_or_n,
51 '--ask' : y_or_n,
52 '--autounmask' : y_or_n,
53 + '--autounmask-only' : y_or_n,
54 '--autounmask-keep-masks': y_or_n,
55 '--autounmask-unrestricted-atoms' : y_or_n,
56 '--autounmask-write' : y_or_n,
57 @@ -323,6 +324,11 @@ def parse_opts(tmpcmdline, silent=False):
58 "choices" : true_y_or_n
59 },
60
61 + "--autounmask-only": {
62 + "help" : "only perform --autounmask",
63 + "choices" : true_y_or_n
64 + },
65 +
66 "--autounmask-unrestricted-atoms": {
67 "help" : "write autounmask changes with >= atoms if possible",
68 "choices" : true_y_or_n
69 @@ -745,6 +751,11 @@ def parse_opts(tmpcmdline, silent=False):
70 if myoptions.autounmask in true_y:
71 myoptions.autounmask = True
72
73 + if myoptions.autounmask_only in true_y:
74 + myoptions.autounmask_only = True
75 + else:
76 + myoptions.autounmask_only = None
77 +
78 if myoptions.autounmask_unrestricted_atoms in true_y:
79 myoptions.autounmask_unrestricted_atoms = True
80
81 --
82 2.4.10

Replies