1 |
commit: 25b22ab96b2fabcc9e53ad399591c3e6fd29ec7f |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Aug 15 19:09:10 2020 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Aug 17 03:47:52 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=25b22ab9 |
7 |
|
8 |
emerge: Remove deprecated --changelog option (bug 699256) |
9 |
|
10 |
Bug: https://bugs.gentoo.org/699256 |
11 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
12 |
|
13 |
lib/_emerge/actions.py | 5 -- |
14 |
lib/_emerge/main.py | 3 +- |
15 |
lib/_emerge/resolver/output.py | 32 +--------- |
16 |
lib/_emerge/resolver/output_helpers.py | 113 +-------------------------------- |
17 |
man/emerge.1 | 6 -- |
18 |
5 files changed, 3 insertions(+), 156 deletions(-) |
19 |
|
20 |
diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py |
21 |
index d259206ad..063f5d4a0 100644 |
22 |
--- a/lib/_emerge/actions.py |
23 |
+++ b/lib/_emerge/actions.py |
24 |
@@ -2936,11 +2936,6 @@ def run_action(emerge_config): |
25 |
|
26 |
adjust_configs(emerge_config.opts, emerge_config.trees) |
27 |
|
28 |
- if "--changelog" in emerge_config.opts: |
29 |
- writemsg_level( |
30 |
- " %s The emerge --changelog (or -l) option is deprecated\n" % |
31 |
- warn("*"), level=logging.WARNING, noiselevel=-1) |
32 |
- |
33 |
if profile_check(emerge_config.trees, emerge_config.action) != os.EX_OK: |
34 |
return 1 |
35 |
|
36 |
|
37 |
diff --git a/lib/_emerge/main.py b/lib/_emerge/main.py |
38 |
index f4c7e2715..5aac451fe 100644 |
39 |
--- a/lib/_emerge/main.py |
40 |
+++ b/lib/_emerge/main.py |
41 |
@@ -26,7 +26,7 @@ options=[ |
42 |
"--ask-enter-invalid", |
43 |
"--buildpkgonly", |
44 |
"--changed-use", |
45 |
-"--changelog", "--columns", |
46 |
+"--columns", |
47 |
"--debug", |
48 |
"--digest", |
49 |
"--emptytree", |
50 |
@@ -58,7 +58,6 @@ shortmapping={ |
51 |
"e":"--emptytree", |
52 |
"f":"--fetchonly", "F":"--fetch-all-uri", |
53 |
"h":"--help", |
54 |
-"l":"--changelog", |
55 |
"n":"--noreplace", "N":"--newuse", |
56 |
"o":"--onlydeps", "O":"--nodeps", |
57 |
"p":"--pretend", "P":"--prune", |
58 |
|
59 |
diff --git a/lib/_emerge/resolver/output.py b/lib/_emerge/resolver/output.py |
60 |
index b6c77ecad..0c90abefb 100644 |
61 |
--- a/lib/_emerge/resolver/output.py |
62 |
+++ b/lib/_emerge/resolver/output.py |
63 |
@@ -26,7 +26,7 @@ from portage.versions import best, cpv_getversion |
64 |
from _emerge.Blocker import Blocker |
65 |
from _emerge.create_world_atom import create_world_atom |
66 |
from _emerge.resolver.output_helpers import ( _DisplayConfig, _tree_display, |
67 |
- _PackageCounters, _create_use_string, _calc_changelog, PkgInfo) |
68 |
+ _PackageCounters, _create_use_string, PkgInfo) |
69 |
from _emerge.show_invalid_depstring_notice import show_invalid_depstring_notice |
70 |
|
71 |
class Display: |
72 |
@@ -39,7 +39,6 @@ class Display: |
73 |
""" |
74 |
|
75 |
def __init__(self): |
76 |
- self.changelogs = [] |
77 |
self.print_msg = [] |
78 |
self.blockers = [] |
79 |
self.counters = _PackageCounters() |
80 |
@@ -561,14 +560,6 @@ class Display: |
81 |
noiselevel=-1) |
82 |
|
83 |
|
84 |
- def print_changelog(self): |
85 |
- """Prints the changelog text to std_out |
86 |
- """ |
87 |
- for chunk in self.changelogs: |
88 |
- writemsg_stdout(chunk, |
89 |
- noiselevel=-1) |
90 |
- |
91 |
- |
92 |
def get_display_list(self, mylist): |
93 |
"""Determines the display list to process |
94 |
|
95 |
@@ -668,23 +659,6 @@ class Display: |
96 |
return pkg_info |
97 |
|
98 |
|
99 |
- def do_changelog(self, pkg, pkg_info): |
100 |
- """Processes and adds the changelog text to the master text for output |
101 |
- |
102 |
- @param pkg: _emerge.Package.Package instance |
103 |
- @param pkg_info: dictionay |
104 |
- Modifies self.changelogs |
105 |
- """ |
106 |
- if pkg_info.previous_pkg is not None: |
107 |
- ebuild_path_cl = pkg_info.ebuild_path |
108 |
- if ebuild_path_cl is None: |
109 |
- # binary package |
110 |
- ebuild_path_cl = self.portdb.findname(pkg.cpv, myrepo=pkg.repo) |
111 |
- if ebuild_path_cl is not None: |
112 |
- self.changelogs.extend(_calc_changelog( |
113 |
- ebuild_path_cl, pkg_info.previous_pkg, pkg.cpv)) |
114 |
- |
115 |
- |
116 |
def check_system_world(self, pkg): |
117 |
"""Checks for any occurances of the package in the system or world sets |
118 |
|
119 |
@@ -780,8 +754,6 @@ class Display: |
120 |
pkg_info.attr_display.new_slot = True |
121 |
if pkg_info.ordered: |
122 |
self.counters.newslot += 1 |
123 |
- if self.conf.changelog: |
124 |
- self.do_changelog(pkg, pkg_info) |
125 |
else: |
126 |
pkg_info.attr_display.new = True |
127 |
if pkg_info.ordered: |
128 |
@@ -909,8 +881,6 @@ class Display: |
129 |
noiselevel=-1) |
130 |
spawn_nofetch(self.conf.trees[pkg.root]["porttree"].dbapi, |
131 |
pkg_info.ebuild_path) |
132 |
- if self.conf.changelog: |
133 |
- self.print_changelog() |
134 |
|
135 |
return os.EX_OK |
136 |
|
137 |
|
138 |
diff --git a/lib/_emerge/resolver/output_helpers.py b/lib/_emerge/resolver/output_helpers.py |
139 |
index 932e66e1b..30000e93f 100644 |
140 |
--- a/lib/_emerge/resolver/output_helpers.py |
141 |
+++ b/lib/_emerge/resolver/output_helpers.py |
142 |
@@ -8,20 +8,15 @@ in output.py |
143 |
__all__ = ( |
144 |
) |
145 |
|
146 |
-import io |
147 |
-import re |
148 |
- |
149 |
from portage import os |
150 |
-from portage import _encodings, _unicode_encode |
151 |
from portage._sets.base import InternalPackageSet |
152 |
from portage.exception import PackageSetNotFound |
153 |
from portage.localization import localized_size |
154 |
-from portage.output import (blue, bold, colorize, create_color_func, |
155 |
+from portage.output import (blue, colorize, create_color_func, |
156 |
green, red, teal, turquoise, yellow) |
157 |
bad = create_color_func("BAD") |
158 |
from portage.util import writemsg |
159 |
from portage.util.SlotObject import SlotObject |
160 |
-from portage.versions import catpkgsplit |
161 |
|
162 |
from _emerge.Blocker import Blocker |
163 |
from _emerge.Package import Package |
164 |
@@ -176,7 +171,6 @@ class _DisplayConfig: |
165 |
self.quiet = "--quiet" in frozen_config.myopts |
166 |
self.all_flags = self.verbosity == 3 or self.quiet |
167 |
self.print_use_string = self.verbosity != 1 or "--verbose" in frozen_config.myopts |
168 |
- self.changelog = "--changelog" in frozen_config.myopts |
169 |
self.edebug = frozen_config.edebug |
170 |
self.unordered_display = "--unordered-display" in frozen_config.myopts |
171 |
|
172 |
@@ -468,90 +462,6 @@ def _prune_tree_display(display_list): |
173 |
depth >= display_list[i+1][1]: |
174 |
del display_list[i] |
175 |
|
176 |
- |
177 |
-def _calc_changelog(ebuildpath,current,next): # pylint: disable=redefined-builtin |
178 |
- if ebuildpath == None or not os.path.exists(ebuildpath): |
179 |
- return [] |
180 |
- current = '-'.join(catpkgsplit(current)[1:]) |
181 |
- if current.endswith('-r0'): |
182 |
- current = current[:-3] |
183 |
- next = '-'.join(catpkgsplit(next)[1:]) |
184 |
- if next.endswith('-r0'): |
185 |
- next = next[:-3] |
186 |
- |
187 |
- changelogdir = os.path.dirname(ebuildpath) |
188 |
- changelogs = ['ChangeLog'] |
189 |
- # ChangeLog-YYYY (see bug #389611) |
190 |
- changelogs.extend(sorted((fn for fn in os.listdir(changelogdir) |
191 |
- if fn.startswith('ChangeLog-')), reverse=True)) |
192 |
- |
193 |
- divisions = [] |
194 |
- found_current = False |
195 |
- for fn in changelogs: |
196 |
- changelogpath = os.path.join(changelogdir, fn) |
197 |
- try: |
198 |
- with io.open(_unicode_encode(changelogpath, |
199 |
- encoding=_encodings['fs'], errors='strict'), |
200 |
- mode='r', encoding=_encodings['repo.content'], |
201 |
- errors='replace') as f: |
202 |
- changelog = f.read() |
203 |
- except EnvironmentError: |
204 |
- return [] |
205 |
- for node in _find_changelog_tags(changelog): |
206 |
- if node[0] == current: |
207 |
- found_current = True |
208 |
- break |
209 |
- else: |
210 |
- divisions.append(node) |
211 |
- if found_current: |
212 |
- break |
213 |
- |
214 |
- if not found_current: |
215 |
- return [] |
216 |
- |
217 |
- #print 'XX from',current,'to',next |
218 |
- #for div,text in divisions: print 'XX',div |
219 |
- # skip entries for all revisions above the one we are about to emerge |
220 |
- later_rev_index = None |
221 |
- for i, node in enumerate(divisions): |
222 |
- if node[0] == next: |
223 |
- if later_rev_index is not None: |
224 |
- first_node = divisions[later_rev_index] |
225 |
- # Discard the later revision and the first ChangeLog entry |
226 |
- # that follows it. We want to display all the entries after |
227 |
- # that first entry, as discussed in bug #373009. |
228 |
- trimmed_lines = [] |
229 |
- iterator = iter(first_node[1]) |
230 |
- for l in iterator: |
231 |
- if not l: |
232 |
- # end of the first entry that's discarded |
233 |
- break |
234 |
- first_node = (None, list(iterator)) |
235 |
- divisions = [first_node] + divisions[later_rev_index+1:] |
236 |
- break |
237 |
- if node[0] is not None: |
238 |
- later_rev_index = i |
239 |
- |
240 |
- output = [] |
241 |
- prev_blank = False |
242 |
- prev_rev = False |
243 |
- for rev, lines in divisions: |
244 |
- if rev is not None: |
245 |
- if not (prev_blank or prev_rev): |
246 |
- output.append("\n") |
247 |
- output.append(bold('*' + rev) + '\n') |
248 |
- prev_rev = True |
249 |
- prev_blank = False |
250 |
- if lines: |
251 |
- prev_rev = False |
252 |
- if not prev_blank: |
253 |
- output.append("\n") |
254 |
- for l in lines: |
255 |
- output.append(l + "\n") |
256 |
- output.append("\n") |
257 |
- prev_blank = True |
258 |
- return output |
259 |
- |
260 |
def _strip_header_comments(lines): |
261 |
# strip leading and trailing blank or header/comment lines |
262 |
i = 0 |
263 |
@@ -563,27 +473,6 @@ def _strip_header_comments(lines): |
264 |
lines.pop() |
265 |
return lines |
266 |
|
267 |
-def _find_changelog_tags(changelog): |
268 |
- divs = [] |
269 |
- if not changelog: |
270 |
- return divs |
271 |
- release = None |
272 |
- release_end = 0 |
273 |
- for match in re.finditer(r'^\*\ ?([-a-zA-Z0-9_.+]*)(?:\ .*)?$', |
274 |
- changelog, re.M): |
275 |
- divs.append((release, _strip_header_comments( |
276 |
- changelog[release_end:match.start()].splitlines()))) |
277 |
- release_end = match.end() |
278 |
- release = match.group(1) |
279 |
- if release.endswith('.ebuild'): |
280 |
- release = release[:-7] |
281 |
- if release.endswith('-r0'): |
282 |
- release = release[:-3] |
283 |
- |
284 |
- divs.append((release, |
285 |
- _strip_header_comments(changelog[release_end:].splitlines()))) |
286 |
- return divs |
287 |
- |
288 |
class PkgInfo: |
289 |
"""Simple class to hold instance attributes for current |
290 |
information about the pkg being printed. |
291 |
|
292 |
diff --git a/man/emerge.1 b/man/emerge.1 |
293 |
index a8be677d6..9f77d1fa2 100644 |
294 |
--- a/man/emerge.1 |
295 |
+++ b/man/emerge.1 |
296 |
@@ -504,12 +504,6 @@ NOTE: This option ignores the state of the "test" USE flag, since that flag |
297 |
has a special binding to FEATURES="test" (see \fBmake.conf\fR(5) for more |
298 |
information about \fBFEATURES\fR settings). |
299 |
.TP |
300 |
-.BR \-\-changelog ", " \-l |
301 |
-Use this in conjunction with the \fB\-\-pretend\fR option. This will |
302 |
-show the ChangeLog entries for all the packages that will be upgraded. |
303 |
-This option is deprecated because ChangeLog files are no longer |
304 |
-distributed with Gentoo's ebuild repository. |
305 |
-.TP |
306 |
.BR "\-\-color < y | n >" |
307 |
Enable or disable color output. This option will override \fINOCOLOR\fR |
308 |
(see \fBmake.conf\fR(5)) and may also be used to force color output when stdout |