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