1 |
commit: 55ad426b76e66fbef88dca3274172f5a30903ae6 |
2 |
Author: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Jan 31 17:15:19 2017 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 31 18:11:24 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=55ad426b |
7 |
|
8 |
Fix Python 3.6 "DeprecationWarning: invalid escape sequence" warnings (bug 607418) |
9 |
|
10 |
X-Gentoo-Bug: 607418 |
11 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=607418 |
12 |
|
13 |
bin/check-implicit-pointer-usage.py | 22 +++++++++++----------- |
14 |
bin/dispatch-conf | 4 ++-- |
15 |
pym/_emerge/main.py | 4 ++-- |
16 |
pym/portage/cvstree.py | 6 +++--- |
17 |
pym/portage/glsa.py | 4 ++-- |
18 |
pym/portage/news.py | 4 ++-- |
19 |
pym/portage/package/ebuild/fetch.py | 4 ++-- |
20 |
pym/portage/tests/util/test_getconfig.py | 4 ++-- |
21 |
pym/portage/tests/util/test_varExpand.py | 4 ++-- |
22 |
pym/portage/util/__init__.py | 4 ++-- |
23 |
pym/portage/util/lafilefixer.py | 8 ++++---- |
24 |
pym/portage/xml/metadata.py | 4 ++-- |
25 |
repoman/pym/repoman/modules/vcs/cvs/changes.py | 2 +- |
26 |
repoman/pym/repoman/modules/vcs/cvs/status.py | 6 +++--- |
27 |
repoman/pym/repoman/modules/vcs/svn/changes.py | 2 +- |
28 |
15 files changed, 41 insertions(+), 41 deletions(-) |
29 |
|
30 |
diff --git a/bin/check-implicit-pointer-usage.py b/bin/check-implicit-pointer-usage.py |
31 |
index 242436c..a49db81 100755 |
32 |
--- a/bin/check-implicit-pointer-usage.py |
33 |
+++ b/bin/check-implicit-pointer-usage.py |
34 |
@@ -19,19 +19,19 @@ from __future__ import print_function |
35 |
import re |
36 |
import sys |
37 |
|
38 |
-implicit_pattern = re.compile("([^:]*):(\d+): warning: implicit declaration " |
39 |
+implicit_pattern = re.compile(r"([^:]*):(\d+): warning: implicit declaration " |
40 |
+ "of function [`']([^']*)'") |
41 |
pointer_pattern = ( |
42 |
- "([^:]*):(\d+): warning: " |
43 |
- + "(" |
44 |
- + "(assignment" |
45 |
- + "|initialization" |
46 |
- + "|return" |
47 |
- + "|passing arg \d+ of `[^']*'" |
48 |
- + "|passing arg \d+ of pointer to function" |
49 |
- + ") makes pointer from integer without a cast" |
50 |
- + "|" |
51 |
- + "cast to pointer from integer of different size)") |
52 |
+ r"([^:]*):(\d+): warning: " |
53 |
+ + r"(" |
54 |
+ + r"(assignment" |
55 |
+ + r"|initialization" |
56 |
+ + r"|return" |
57 |
+ + r"|passing arg \d+ of `[^']*'" |
58 |
+ + r"|passing arg \d+ of pointer to function" |
59 |
+ + r") makes pointer from integer without a cast" |
60 |
+ + r"|" |
61 |
+ + r"cast to pointer from integer of different size)") |
62 |
|
63 |
if sys.hexversion < 0x3000000: |
64 |
# Use encoded byte strings in python-2.x, since the python ebuilds are |
65 |
|
66 |
diff --git a/bin/dispatch-conf b/bin/dispatch-conf |
67 |
index fdf564e..099c37f 100755 |
68 |
--- a/bin/dispatch-conf |
69 |
+++ b/bin/dispatch-conf |
70 |
@@ -1,5 +1,5 @@ |
71 |
#!/usr/bin/python -bO |
72 |
-# Copyright 1999-2016 Gentoo Foundation |
73 |
+# Copyright 1999-2017 Gentoo Foundation |
74 |
# Distributed under the terms of the GNU General Public License v2 |
75 |
|
76 |
# |
77 |
@@ -222,7 +222,7 @@ class dispatch: |
78 |
# Filter out comments and whitespace-only changes. |
79 |
# Note: be nice to also ignore lines that only differ in whitespace... |
80 |
wsc_lines = [] |
81 |
- for x in ['^[-+]\s*#', '^[-+]\s*$']: |
82 |
+ for x in [r'^[-+]\s*#', r'^[-+]\s*$']: |
83 |
wsc_lines += list(filter(re.compile(x).match, mylines)) |
84 |
same_wsc = len(mylines) == len(wsc_lines) |
85 |
|
86 |
|
87 |
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py |
88 |
index eae1954..a83b328 100644 |
89 |
--- a/pym/_emerge/main.py |
90 |
+++ b/pym/_emerge/main.py |
91 |
@@ -1,4 +1,4 @@ |
92 |
-# Copyright 1999-2016 Gentoo Foundation |
93 |
+# Copyright 1999-2017 Gentoo Foundation |
94 |
# Distributed under the terms of the GNU General Public License v2 |
95 |
|
96 |
from __future__ import print_function |
97 |
@@ -73,7 +73,7 @@ shortmapping={ |
98 |
"V":"--version" |
99 |
} |
100 |
|
101 |
-COWSAY_MOO = """ |
102 |
+COWSAY_MOO = r""" |
103 |
|
104 |
Larry loves Gentoo (%s) |
105 |
|
106 |
|
107 |
diff --git a/pym/portage/cvstree.py b/pym/portage/cvstree.py |
108 |
index 4a3afae..87bbed8 100644 |
109 |
--- a/pym/portage/cvstree.py |
110 |
+++ b/pym/portage/cvstree.py |
111 |
@@ -1,5 +1,5 @@ |
112 |
# cvstree.py -- cvs tree utilities |
113 |
-# Copyright 1998-2014 Gentoo Foundation |
114 |
+# Copyright 1998-2017 Gentoo Foundation |
115 |
# Distributed under the terms of the GNU General Public License v2 |
116 |
|
117 |
from __future__ import print_function |
118 |
@@ -61,7 +61,7 @@ def isadded(entries, path): |
119 |
mylines = myfile.readlines() |
120 |
myfile.close() |
121 |
|
122 |
- rep = re.compile("^\/%s\/" % re.escape(filename)) |
123 |
+ rep = re.compile(r"^\/%s\/" % re.escape(filename)) |
124 |
for x in mylines: |
125 |
if rep.search(x): |
126 |
return 1 |
127 |
@@ -201,7 +201,7 @@ def findall(entries, recursive=0, basedir=""): |
128 |
myremoved = findremoved(entries, recursive, basedir) |
129 |
return [mynew, mychanged, mymissing, myunadded, myremoved] |
130 |
|
131 |
-ignore_list = re.compile("(^|/)(RCS(|LOG)|SCCS|CVS(|\.adm)|cvslog\..*|tags|TAGS|\.(make\.state|nse_depinfo)|.*~|(\.|)#.*|,.*|_$.*|.*\$|\.del-.*|.*\.(old|BAK|bak|orig|rej|a|olb|o|obj|so|exe|Z|elc|ln)|core)$") |
132 |
+ignore_list = re.compile(r"(^|/)(RCS(|LOG)|SCCS|CVS(|\.adm)|cvslog\..*|tags|TAGS|\.(make\.state|nse_depinfo)|.*~|(\.|)#.*|,.*|_$.*|.*\$|\.del-.*|.*\.(old|BAK|bak|orig|rej|a|olb|o|obj|so|exe|Z|elc|ln)|core)$") |
133 |
def apply_cvsignore_filter(list): |
134 |
x = 0 |
135 |
while x < len(list): |
136 |
|
137 |
diff --git a/pym/portage/glsa.py b/pym/portage/glsa.py |
138 |
index ea3819b..ccf9343 100644 |
139 |
--- a/pym/portage/glsa.py |
140 |
+++ b/pym/portage/glsa.py |
141 |
@@ -1,4 +1,4 @@ |
142 |
-# Copyright 2003-2014 Gentoo Foundation |
143 |
+# Copyright 2003-2017 Gentoo Foundation |
144 |
# Distributed under the terms of the GNU General Public License v2 |
145 |
|
146 |
from __future__ import absolute_import, unicode_literals |
147 |
@@ -210,7 +210,7 @@ def getText(node, format, textfd = None): |
148 |
rValue = textfd.getvalue() |
149 |
if format == "strip": |
150 |
rValue = rValue.strip(" \n\t") |
151 |
- rValue = re.sub("[\s]{2,}", " ", rValue) |
152 |
+ rValue = re.sub(r"[\s]{2,}", " ", rValue) |
153 |
return rValue |
154 |
|
155 |
def getMultiTagsText(rootnode, tagname, format): |
156 |
|
157 |
diff --git a/pym/portage/news.py b/pym/portage/news.py |
158 |
index 6020074..d4f1429 100644 |
159 |
--- a/pym/portage/news.py |
160 |
+++ b/pym/portage/news.py |
161 |
@@ -1,5 +1,5 @@ |
162 |
# portage: news management code |
163 |
-# Copyright 2006-2014 Gentoo Foundation |
164 |
+# Copyright 2006-2017 Gentoo Foundation |
165 |
# Distributed under the terms of the GNU General Public License v2 |
166 |
|
167 |
from __future__ import print_function, unicode_literals |
168 |
@@ -193,7 +193,7 @@ class NewsManager(object): |
169 |
if unread_lock: |
170 |
unlockfile(unread_lock) |
171 |
|
172 |
-_formatRE = re.compile("News-Item-Format:\s*([^\s]*)\s*$") |
173 |
+_formatRE = re.compile(r"News-Item-Format:\s*([^\s]*)\s*$") |
174 |
_installedRE = re.compile("Display-If-Installed:(.*)\n") |
175 |
_profileRE = re.compile("Display-If-Profile:(.*)\n") |
176 |
_keywordRE = re.compile("Display-If-Keyword:(.*)\n") |
177 |
|
178 |
diff --git a/pym/portage/package/ebuild/fetch.py b/pym/portage/package/ebuild/fetch.py |
179 |
index 1be2800..8755b75 100644 |
180 |
--- a/pym/portage/package/ebuild/fetch.py |
181 |
+++ b/pym/portage/package/ebuild/fetch.py |
182 |
@@ -1,4 +1,4 @@ |
183 |
-# Copyright 2010-2015 Gentoo Foundation |
184 |
+# Copyright 2010-2017 Gentoo Foundation |
185 |
# Distributed under the terms of the GNU General Public License v2 |
186 |
|
187 |
from __future__ import print_function |
188 |
@@ -231,7 +231,7 @@ def _check_distfile(filename, digests, eout, show_errors=1, hash_filter=None): |
189 |
return (False, st) |
190 |
return (True, st) |
191 |
|
192 |
-_fetch_resume_size_re = re.compile('(^[\d]+)([KMGTPEZY]?$)') |
193 |
+_fetch_resume_size_re = re.compile(r'(^[\d]+)([KMGTPEZY]?$)') |
194 |
|
195 |
_size_suffix_map = { |
196 |
'' : 0, |
197 |
|
198 |
diff --git a/pym/portage/tests/util/test_getconfig.py b/pym/portage/tests/util/test_getconfig.py |
199 |
index 05e3147..e79fca4 100644 |
200 |
--- a/pym/portage/tests/util/test_getconfig.py |
201 |
+++ b/pym/portage/tests/util/test_getconfig.py |
202 |
@@ -1,4 +1,4 @@ |
203 |
-# Copyright 2010-2014 Gentoo Foundation |
204 |
+# Copyright 2010-2017 Gentoo Foundation |
205 |
# Distributed under the terms of the GNU General Public License v2 |
206 |
|
207 |
import tempfile |
208 |
@@ -58,7 +58,7 @@ class GetConfigTestCase(TestCase): |
209 |
# Test the mode which is used to parse /etc/env.d and /etc/profile.env. |
210 |
|
211 |
cases = { |
212 |
- 'LESS_TERMCAP_mb': "$\E[01;31m", # bug #410625 |
213 |
+ 'LESS_TERMCAP_mb': r"$\E[01;31m", # bug #410625 |
214 |
} |
215 |
|
216 |
with tempfile.NamedTemporaryFile(mode='wb') as f: |
217 |
|
218 |
diff --git a/pym/portage/tests/util/test_varExpand.py b/pym/portage/tests/util/test_varExpand.py |
219 |
index 498b50e..d8addf2 100644 |
220 |
--- a/pym/portage/tests/util/test_varExpand.py |
221 |
+++ b/pym/portage/tests/util/test_varExpand.py |
222 |
@@ -1,5 +1,5 @@ |
223 |
# test_varExpand.py -- Portage Unit Testing Functionality |
224 |
-# Copyright 2006-2010 Gentoo Foundation |
225 |
+# Copyright 2006-2017 Gentoo Foundation |
226 |
# Distributed under the terms of the GNU General Public License v2 |
227 |
|
228 |
from portage.tests import TestCase |
229 |
@@ -22,7 +22,7 @@ class VarExpandTestCase(TestCase): |
230 |
(result, varDict[key], "${%s}" % key, varDict)) |
231 |
|
232 |
def testVarExpandBackslashes(self): |
233 |
- """ |
234 |
+ r""" |
235 |
We want to behave like bash does when expanding a variable |
236 |
assignment in a sourced file, in which case it performs |
237 |
backslash removal for \\ and \$ but nothing more. It also |
238 |
|
239 |
diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py |
240 |
index 2309d04..c2c871f 100644 |
241 |
--- a/pym/portage/util/__init__.py |
242 |
+++ b/pym/portage/util/__init__.py |
243 |
@@ -1,4 +1,4 @@ |
244 |
-# Copyright 2004-2014 Gentoo Foundation |
245 |
+# Copyright 2004-2017 Gentoo Foundation |
246 |
# Distributed under the terms of the GNU General Public License v2 |
247 |
|
248 |
from __future__ import unicode_literals |
249 |
@@ -709,7 +709,7 @@ def getconfig(mycfg, tolerant=False, allow_sourcing=False, expand=True, |
250 |
lex = _getconfig_shlex(instream=content, infile=mycfg, posix=True, |
251 |
portage_tolerant=tolerant) |
252 |
lex.wordchars = portage._native_string(string.digits + |
253 |
- string.ascii_letters + "~!@#$%*_\:;?,./-+{}") |
254 |
+ string.ascii_letters + r"~!@#$%*_\:;?,./-+{}") |
255 |
lex.quotes = portage._native_string("\"'") |
256 |
if allow_sourcing: |
257 |
lex.allow_sourcing(expand_map) |
258 |
|
259 |
diff --git a/pym/portage/util/lafilefixer.py b/pym/portage/util/lafilefixer.py |
260 |
index 2562d9a..1100103 100644 |
261 |
--- a/pym/portage/util/lafilefixer.py |
262 |
+++ b/pym/portage/util/lafilefixer.py |
263 |
@@ -1,4 +1,4 @@ |
264 |
-# Copyright 2010 Gentoo Foundation |
265 |
+# Copyright 2010-2017 Gentoo Foundation |
266 |
# Distributed under the terms of the GNU General Public License v2 |
267 |
|
268 |
import os as _os |
269 |
@@ -40,8 +40,8 @@ inh_link_flags_re = re.compile(b"inherited_linker_flags='(?P<value>[^']*)'$") |
270 |
#replace 'X11R6/lib' and 'local/lib' with 'lib', no idea what's this about. |
271 |
X11_local_sub = re.compile(b"X11R6/lib|local/lib") |
272 |
#get rid of the '..' |
273 |
-pkgconfig_sub1 = re.compile(b"usr/lib[^/]*/pkgconfig/\.\./\.\.") |
274 |
-pkgconfig_sub2 = re.compile(b"(?P<usrlib>usr/lib[^/]*)/pkgconfig/\.\.") |
275 |
+pkgconfig_sub1 = re.compile(br"usr/lib[^/]*/pkgconfig/\.\./\.\.") |
276 |
+pkgconfig_sub2 = re.compile(br"(?P<usrlib>usr/lib[^/]*)/pkgconfig/\.\.") |
277 |
|
278 |
#detect flags that should go into inherited_linker_flags instead of dependency_libs |
279 |
flag_re = re.compile(b"-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads") |
280 |
@@ -132,7 +132,7 @@ def rewrite_lafile(contents): |
281 |
|
282 |
ladir = X11_local_sub.sub(b"lib", ladir) |
283 |
ladir = pkgconfig_sub1.sub(b"usr", ladir) |
284 |
- ladir = pkgconfig_sub2.sub(b"\g<usrlib>", ladir) |
285 |
+ ladir = pkgconfig_sub2.sub(br"\g<usrlib>", ladir) |
286 |
|
287 |
if ladir not in libladir: |
288 |
libladir.append(ladir) |
289 |
|
290 |
diff --git a/pym/portage/xml/metadata.py b/pym/portage/xml/metadata.py |
291 |
index 39aa738..9e48ddd 100644 |
292 |
--- a/pym/portage/xml/metadata.py |
293 |
+++ b/pym/portage/xml/metadata.py |
294 |
@@ -1,4 +1,4 @@ |
295 |
-# Copyright 2010-2013 Gentoo Foundation |
296 |
+# Copyright 2010-2017 Gentoo Foundation |
297 |
# Distributed under the terms of the GNU General Public License v2 |
298 |
|
299 |
"""Provides an easy-to-use python interface to Gentoo's metadata.xml file. |
300 |
@@ -133,7 +133,7 @@ class _Useflag(object): |
301 |
_desc += child.text if child.text else '' |
302 |
_desc += child.tail if child.tail else '' |
303 |
# This takes care of tabs and newlines left from the file |
304 |
- self.description = re.sub('\s+', ' ', _desc) |
305 |
+ self.description = re.sub(r'\s+', ' ', _desc) |
306 |
|
307 |
def __repr__(self): |
308 |
return "<%s %r>" % (self.__class__.__name__, self.name) |
309 |
|
310 |
diff --git a/repoman/pym/repoman/modules/vcs/cvs/changes.py b/repoman/pym/repoman/modules/vcs/cvs/changes.py |
311 |
index c3d880b..583a96f 100644 |
312 |
--- a/repoman/pym/repoman/modules/vcs/cvs/changes.py |
313 |
+++ b/repoman/pym/repoman/modules/vcs/cvs/changes.py |
314 |
@@ -82,7 +82,7 @@ class Changes(ChangesBase): |
315 |
@param no_expansion: |
316 |
@param expansion: |
317 |
''' |
318 |
- headerstring = "'\$(Header|Id).*\$'" |
319 |
+ headerstring = r"'\$(Header|Id).*\$'" |
320 |
|
321 |
for _file in updates: |
322 |
|
323 |
|
324 |
diff --git a/repoman/pym/repoman/modules/vcs/cvs/status.py b/repoman/pym/repoman/modules/vcs/cvs/status.py |
325 |
index b936aa7..3ec88f1 100644 |
326 |
--- a/repoman/pym/repoman/modules/vcs/cvs/status.py |
327 |
+++ b/repoman/pym/repoman/modules/vcs/cvs/status.py |
328 |
@@ -63,9 +63,9 @@ class Status(object): |
329 |
None (calls sys.exit on fatal problems) |
330 |
""" |
331 |
|
332 |
- cmd = ("cvs -n up 2>/dev/null | " |
333 |
- "egrep '^[^\?] .*' | " |
334 |
- "egrep -v '^. .*/digest-[^/]+|^cvs server: .* -- ignored$'") |
335 |
+ cmd = (r"cvs -n up 2>/dev/null | " |
336 |
+ r"egrep '^[^\?] .*' | " |
337 |
+ r"egrep -v '^. .*/digest-[^/]+|^cvs server: .* -- ignored$'") |
338 |
msg = ("Performing a %s with a little magic grep to check for updates." |
339 |
% green("cvs -n up")) |
340 |
|
341 |
|
342 |
diff --git a/repoman/pym/repoman/modules/vcs/svn/changes.py b/repoman/pym/repoman/modules/vcs/svn/changes.py |
343 |
index 0bb10d8..dfed165 100644 |
344 |
--- a/repoman/pym/repoman/modules/vcs/svn/changes.py |
345 |
+++ b/repoman/pym/repoman/modules/vcs/svn/changes.py |
346 |
@@ -110,7 +110,7 @@ class Changes(ChangesBase): |
347 |
if keyword is not None: |
348 |
enabled_keywords.append(keyword) |
349 |
|
350 |
- headerstring = "'\$(%s).*\$'" % "|".join(enabled_keywords) |
351 |
+ headerstring = r"'\$(%s).*\$'" % "|".join(enabled_keywords) |
352 |
|
353 |
_out = repoman_getstatusoutput( |
354 |
"egrep -q %s %s" % (headerstring, portage._shell_quote(_file))) |