Gentoo Archives: gentoo-portage-dev

From: Alexander Berntsen <bernalex@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Alexander Berntsen <alexander@××××××.net>
Subject: [gentoo-portage-dev] [PATCH 2/4] emerge: Rename --autounmask-write to --autounmask
Date: Tue, 12 Aug 2014 09:37:37
Message-Id: 1407836235-13528-3-git-send-email-bernalex@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 0/4] Autounmask changes by Alexander Berntsen
1 From: Alexander Berntsen <alexander@××××××.net>
2
3 Rename --autounmask-write to --autounmask. Please note that removing the
4 option does not mean that the variable used for keeping track of
5 autounmask writing is removed from depgraph.py.
6
7 Signed-off-by: Alexander Berntsen <bernalex@g.o>
8 ---
9 man/emerge.1 | 19 +++++++++++--------
10 pym/_emerge/depgraph.py | 4 ++--
11 pym/_emerge/main.py | 18 +++++++++---------
12 3 files changed, 22 insertions(+), 19 deletions(-)
13
14 diff --git a/man/emerge.1 b/man/emerge.1
15 index d0a0806..be52f25 100644
16 --- a/man/emerge.1
17 +++ b/man/emerge.1
18 @@ -336,10 +336,20 @@ invalid input. This helps prevent accidental
19 acceptance of the first choice. This option is
20 intended to be set in the \fBmake.conf\fR(5)
21 \fBEMERGE_DEFAULT_OPTS\fR variable.
22 -\fB\-\-autounmask\-write\fR option. The
23 +\fB\-\-autounmask\fR option. The
24 \fBEMERGE_DEFAULT_OPTS\fR variable may be used to
25 disable this option by default in \fBmake.conf\fR(5).
26 .TP
27 +.BR "\-\-autounmask [ y | n ]"
28 +Write required unmask changes to the relevant config files, respecting
29 +\fBCONFIG_PROTECT\fR. If invoked together with \fB\-\-ask\fR, emerge will
30 +prompt you to write the changes. If invoked along with \fB\-\-pretend\fR,
31 +emerge will merely output the required changes and not make any of them by
32 +itself. If the corresponding package.* is a file, the changes are appended to
33 +it, if it is a directory, changes are written to the lexicographically last
34 +file. This way it is always ensured that the new changes take precedence over
35 +existing changes.
36 +.TP
37 .BR "\-\-autounmask\-unrestricted\-atoms [ y | n ]"
38 Keyword and mask changes using the \'=\' operator will be written. With this
39 option, \'>=\' operators will be used whenever possible. USE and license
40 @@ -349,13 +359,6 @@ changes always use the latter behavior.
41 No package.unmask or ** keyword changes will be created if this is activated.
42 This leads to unsatisfied dependencies if no other solution exists.
43 .TP
44 -.BR "\-\-autounmask\-write [ y | n ]"
45 -Write required unmask changes to the relevant config files, respecting
46 -\fBCONFIG_PROTECT\fR and \fB\-\-ask\fR. If the corresponding package.* is a
47 -file, the changes are appended to it, if it is a directory, changes are written
48 -to the lexicographically last file. This way it is always ensured that the new
49 -changes take precedence over existing changes.
50 -.TP
51 .BR \-\-backtrack=COUNT
52 Specifies an integer number of times to backtrack if
53 dependency calculation fails due to a conflict or an
54 diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
55 index b0cfc92..0c6b8e3 100644
56 --- a/pym/_emerge/depgraph.py
57 +++ b/pym/_emerge/depgraph.py
58 @@ -7332,7 +7332,7 @@ class depgraph(object):
59 (using CONFIG_PROTECT). The message includes the comments and the changes.
60 """
61
62 - autounmask_write = self._frozen_config.myopts.get("--autounmask-write", "n") == True
63 + autounmask_write = self._frozen_config.myopts.get("--autounmask", "n") == True
64 autounmask_unrestricted_atoms = \
65 self._frozen_config.myopts.get("--autounmask-unrestricted-atoms", "n") == True
66 quiet = "--quiet" in self._frozen_config.myopts
67 @@ -7694,7 +7694,7 @@ class depgraph(object):
68 chk_updated_cfg_files(root,
69 [os.path.join(os.sep, USER_CONFIG_PATH)])
70 elif not pretend and not autounmask_write and roots:
71 - writemsg("\nUse --autounmask-write to write changes to config files (honoring\n"
72 + writemsg("\nUse --autounmask to write changes to config files (honoring\n"
73 "CONFIG_PROTECT). Carefully examine the list of proposed changes,\n"
74 "paying special attention to mask or keyword changes that may expose\n"
75 "experimental or unstable packages.\n",
76 diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
77 index 86c0c62..f450fa2 100644
78 --- a/pym/_emerge/main.py
79 +++ b/pym/_emerge/main.py
80 @@ -126,9 +126,9 @@ def insert_optional_args(args):
81 default_arg_opts = {
82 '--alert' : y_or_n,
83 '--ask' : y_or_n,
84 + '--autounmask' : y_or_n,
85 '--autounmask-keep-masks': y_or_n,
86 '--autounmask-unrestricted-atoms' : y_or_n,
87 - '--autounmask-write' : y_or_n,
88 '--buildpkg' : y_or_n,
89 '--complete-graph' : y_or_n,
90 '--deep' : valid_integers,
91 @@ -313,6 +313,11 @@ def parse_opts(tmpcmdline, silent=False):
92 "choices" : true_y_or_n
93 },
94
95 + "--autounmask": {
96 + "help" : "automatically unmask packages",
97 + "choices" : true_y_or_n
98 + },
99 +
100 "--autounmask-unrestricted-atoms": {
101 "help" : "write autounmask changes with >= atoms if possible",
102 "choices" : true_y_or_n
103 @@ -323,11 +328,6 @@ def parse_opts(tmpcmdline, silent=False):
104 "choices" : true_y_or_n
105 },
106
107 - "--autounmask-write": {
108 - "help" : "write changes made by --autounmask to disk",
109 - "choices" : true_y_or_n
110 - },
111 -
112 "--accept-properties": {
113 "help":"temporarily override ACCEPT_PROPERTIES",
114 "action":"store"
115 @@ -687,15 +687,15 @@ def parse_opts(tmpcmdline, silent=False):
116 else:
117 myoptions.ask = None
118
119 + if myoptions.autounmask in true_y:
120 + myoptions.autounmask = True
121 +
122 if myoptions.autounmask_unrestricted_atoms in true_y:
123 myoptions.autounmask_unrestricted_atoms = True
124
125 if myoptions.autounmask_keep_masks in true_y:
126 myoptions.autounmask_keep_masks = True
127
128 - if myoptions.autounmask_write in true_y:
129 - myoptions.autounmask_write = True
130 -
131 if myoptions.buildpkg in true_y:
132 myoptions.buildpkg = True
133
134 --
135 1.8.5.5