Gentoo Archives: gentoo-portage-dev

From: Lucian Poston <lucian.poston@×××××.com>
To: gentoo-portage-dev@l.g.o
Cc: Lucian Poston <lucian.poston@×××××.com>
Subject: [gentoo-portage-dev] [PATCH] emerge: Add --autounmask-only parameter
Date: Wed, 23 Dec 2015 21:41:34
Message-Id: 1450906772-14853-1-git-send-email-lucian.poston@gmail.com
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 man/emerge.1 | 6 ++++++
6 pym/_emerge/actions.py | 4 ++++
7 pym/_emerge/depgraph.py | 4 ++--
8 pym/_emerge/main.py | 11 +++++++++++
9 4 files changed, 23 insertions(+), 2 deletions(-)
10
11 diff --git a/man/emerge.1 b/man/emerge.1
12 index c03f044..05b2a01 100644
13 --- a/man/emerge.1
14 +++ b/man/emerge.1
15 @@ -361,6 +361,12 @@ the specified configuration file(s), or enable the
16 \fBEMERGE_DEFAULT_OPTS\fR variable may be used to
17 disable this option by default in \fBmake.conf\fR(5).
18 .TP
19 +.BR "\-\-autounmask\-only [ y | n ]"
20 +Instead of doing any package building, just unmask
21 +packages and generate package.use settings as necessary
22 +to satisfy dependencies. This option is disabled by
23 +default.
24 +.TP
25 .BR "\-\-autounmask\-unrestricted\-atoms [ y | n ]"
26 If \-\-autounmask is enabled, keyword and mask changes
27 using the \'=\' operator will be written. With this
28 diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
29 index a080ba4..5004fd1 100644
30 --- a/pym/_emerge/actions.py
31 +++ b/pym/_emerge/actions.py
32 @@ -327,6 +327,10 @@ def action_build(settings, trees, mtimedb,
33 display_missing_pkg_set(root_config, e.value)
34 return 1
35
36 + if "--autounmask-only" in myopts:
37 + mydepgraph.display_autounmask()
38 + return 0
39 +
40 if not success:
41 mydepgraph.display_problems()
42 return 1
43 diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
44 index 2169b00..6984f06 100644
45 --- a/pym/_emerge/depgraph.py
46 +++ b/pym/_emerge/depgraph.py
47 @@ -7972,7 +7972,7 @@ class depgraph(object):
48
49 return display(self, mylist, favorites, verbosity)
50
51 - def _display_autounmask(self):
52 + def display_autounmask(self):
53 """
54 Display --autounmask message and optionally write it to config files
55 (using CONFIG_PROTECT). The message includes the comments and the changes.
56 @@ -8395,7 +8395,7 @@ class depgraph(object):
57
58 self._show_ignored_binaries()
59
60 - self._display_autounmask()
61 + self.display_autounmask()
62
63 for depgraph_sets in self._dynamic_config.sets.values():
64 for pset in depgraph_sets.sets.values():
65 diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
66 index 5a8b93c..5dbafee 100644
67 --- a/pym/_emerge/main.py
68 +++ b/pym/_emerge/main.py
69 @@ -127,6 +127,7 @@ def insert_optional_args(args):
70 '--alert' : y_or_n,
71 '--ask' : y_or_n,
72 '--autounmask' : y_or_n,
73 + '--autounmask-only' : y_or_n,
74 '--autounmask-keep-masks': y_or_n,
75 '--autounmask-unrestricted-atoms' : y_or_n,
76 '--autounmask-write' : y_or_n,
77 @@ -323,6 +324,11 @@ def parse_opts(tmpcmdline, silent=False):
78 "choices" : true_y_or_n
79 },
80
81 + "--autounmask-only": {
82 + "help" : "only perform --autounmask",
83 + "choices" : true_y_or_n
84 + },
85 +
86 "--autounmask-unrestricted-atoms": {
87 "help" : "write autounmask changes with >= atoms if possible",
88 "choices" : true_y_or_n
89 @@ -745,6 +751,11 @@ def parse_opts(tmpcmdline, silent=False):
90 if myoptions.autounmask in true_y:
91 myoptions.autounmask = True
92
93 + if myoptions.autounmask_only in true_y:
94 + myoptions.autounmask_only = True
95 + else:
96 + myoptions.autounmask_only = None
97 +
98 if myoptions.autounmask_unrestricted_atoms in true_y:
99 myoptions.autounmask_unrestricted_atoms = True
100
101 --
102 2.4.10

Replies