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 v2] emerge: Add --autounmask-only parameter
Date: Thu, 24 Dec 2015 14:39:04
Message-Id: 1450967926-16320-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 man/emerge.1 | 6 ++++++
6 pym/_emerge/actions.py | 4 ++++
7 pym/_emerge/main.py | 11 +++++++++++
8 3 files changed, 21 insertions(+)
9
10 diff --git a/man/emerge.1 b/man/emerge.1
11 index c03f044..05b2a01 100644
12 --- a/man/emerge.1
13 +++ b/man/emerge.1
14 @@ -361,6 +361,12 @@ the specified configuration file(s), or enable the
15 \fBEMERGE_DEFAULT_OPTS\fR variable may be used to
16 disable this option by default in \fBmake.conf\fR(5).
17 .TP
18 +.BR "\-\-autounmask\-only [ y | n ]"
19 +Instead of doing any package building, just unmask
20 +packages and generate package.use settings as necessary
21 +to satisfy dependencies. This option is disabled by
22 +default.
23 +.TP
24 .BR "\-\-autounmask\-unrestricted\-atoms [ y | n ]"
25 If \-\-autounmask is enabled, keyword and mask changes
26 using the \'=\' operator will be written. With this
27 diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
28 index a080ba4..1c59abd 100644
29 --- a/pym/_emerge/actions.py
30 +++ b/pym/_emerge/actions.py
31 @@ -327,6 +327,10 @@ def action_build(settings, trees, mtimedb,
32 display_missing_pkg_set(root_config, e.value)
33 return 1
34
35 + if "--autounmask-only" in myopts:
36 + mydepgraph.display_problems()
37 + return 0
38 +
39 if not success:
40 mydepgraph.display_problems()
41 return 1
42 diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
43 index 5a8b93c..5dbafee 100644
44 --- a/pym/_emerge/main.py
45 +++ b/pym/_emerge/main.py
46 @@ -127,6 +127,7 @@ def insert_optional_args(args):
47 '--alert' : y_or_n,
48 '--ask' : y_or_n,
49 '--autounmask' : y_or_n,
50 + '--autounmask-only' : y_or_n,
51 '--autounmask-keep-masks': y_or_n,
52 '--autounmask-unrestricted-atoms' : y_or_n,
53 '--autounmask-write' : y_or_n,
54 @@ -323,6 +324,11 @@ def parse_opts(tmpcmdline, silent=False):
55 "choices" : true_y_or_n
56 },
57
58 + "--autounmask-only": {
59 + "help" : "only perform --autounmask",
60 + "choices" : true_y_or_n
61 + },
62 +
63 "--autounmask-unrestricted-atoms": {
64 "help" : "write autounmask changes with >= atoms if possible",
65 "choices" : true_y_or_n
66 @@ -745,6 +751,11 @@ def parse_opts(tmpcmdline, silent=False):
67 if myoptions.autounmask in true_y:
68 myoptions.autounmask = True
69
70 + if myoptions.autounmask_only in true_y:
71 + myoptions.autounmask_only = True
72 + else:
73 + myoptions.autounmask_only = None
74 +
75 if myoptions.autounmask_unrestricted_atoms in true_y:
76 myoptions.autounmask_unrestricted_atoms = True
77
78 --
79 2.4.10

Replies