##// END OF EJS Templates
hghave: matchoutput needs to use bytes for regexp...
timeless -
r29140:47eab0cb default
parent child Browse files
Show More
@@ -104,7 +104,7 b' def matchoutput(cmd, regexp, ignorestatu'
104 104
105 105 @check("baz", "GNU Arch baz client")
106 106 def has_baz():
107 return matchoutput('baz --version 2>&1', r'baz Bazaar version')
107 return matchoutput('baz --version 2>&1', br'baz Bazaar version')
108 108
109 109 @check("bzr", "Canonical's Bazaar client")
110 110 def has_bzr():
@@ -130,27 +130,27 b' def has_chg():'
130 130
131 131 @check("cvs", "cvs client/server")
132 132 def has_cvs():
133 re = r'Concurrent Versions System.*?server'
133 re = br'Concurrent Versions System.*?server'
134 134 return matchoutput('cvs --version 2>&1', re) and not has_msys()
135 135
136 136 @check("cvs112", "cvs client/server 1.12.* (not cvsnt)")
137 137 def has_cvs112():
138 re = r'Concurrent Versions System \(CVS\) 1.12.*?server'
138 re = br'Concurrent Versions System \(CVS\) 1.12.*?server'
139 139 return matchoutput('cvs --version 2>&1', re) and not has_msys()
140 140
141 141 @check("cvsnt", "cvsnt client/server")
142 142 def has_cvsnt():
143 re = r'Concurrent Versions System \(CVSNT\) (\d+).(\d+).*\(client/server\)'
143 re = br'Concurrent Versions System \(CVSNT\) (\d+).(\d+).*\(client/server\)'
144 144 return matchoutput('cvsnt --version 2>&1', re)
145 145
146 146 @check("darcs", "darcs client")
147 147 def has_darcs():
148 return matchoutput('darcs --version', r'2\.[2-9]', True)
148 return matchoutput('darcs --version', br'2\.[2-9]', True)
149 149
150 150 @check("mtn", "monotone client (>= 1.0)")
151 151 def has_mtn():
152 return matchoutput('mtn --version', r'monotone', True) and not matchoutput(
153 'mtn --version', r'monotone 0\.', True)
152 return matchoutput('mtn --version', br'monotone', True) and not matchoutput(
153 'mtn --version', br'monotone 0\.', True)
154 154
155 155 @check("eol-in-paths", "end-of-lines in paths")
156 156 def has_eol_in_paths():
@@ -236,7 +236,7 b' def has_lsprof():'
236 236 return False
237 237
238 238 def gethgversion():
239 m = matchoutput('hg --version --quiet 2>&1', r'(\d+)\.(\d+)')
239 m = matchoutput('hg --version --quiet 2>&1', br'(\d+)\.(\d+)')
240 240 if not m:
241 241 return (0, 0)
242 242 return (int(m.group(1)), int(m.group(2)))
@@ -267,11 +267,11 b' def has_hg06():'
267 267
268 268 @check("gettext", "GNU Gettext (msgfmt)")
269 269 def has_gettext():
270 return matchoutput('msgfmt --version', 'GNU gettext-tools')
270 return matchoutput('msgfmt --version', br'GNU gettext-tools')
271 271
272 272 @check("git", "git command line client")
273 273 def has_git():
274 return matchoutput('git --version 2>&1', r'^git version')
274 return matchoutput('git --version 2>&1', br'^git version')
275 275
276 276 @check("docutils", "Docutils text processing library")
277 277 def has_docutils():
@@ -283,7 +283,7 b' def has_docutils():'
283 283 return False
284 284
285 285 def getsvnversion():
286 m = matchoutput('svn --version --quiet 2>&1', r'^(\d+)\.(\d+)')
286 m = matchoutput('svn --version --quiet 2>&1', br'^(\d+)\.(\d+)')
287 287 if not m:
288 288 return (0, 0)
289 289 return (int(m.group(1)), int(m.group(2)))
@@ -295,8 +295,8 b' def has_svn_range(v):'
295 295
296 296 @check("svn", "subversion client and admin tools")
297 297 def has_svn():
298 return matchoutput('svn --version 2>&1', r'^svn, version') and \
299 matchoutput('svnadmin --version 2>&1', r'^svnadmin, version')
298 return matchoutput('svn --version 2>&1', br'^svn, version') and \
299 matchoutput('svnadmin --version 2>&1', br'^svnadmin, version')
300 300
301 301 @check("svn-bindings", "subversion python bindings")
302 302 def has_svn_bindings():
@@ -311,8 +311,8 b' def has_svn_bindings():'
311 311
312 312 @check("p4", "Perforce server and client")
313 313 def has_p4():
314 return (matchoutput('p4 -V', r'Rev\. P4/') and
315 matchoutput('p4d -V', r'Rev\. P4D/'))
314 return (matchoutput('p4 -V', br'Rev\. P4/') and
315 matchoutput('p4d -V', br'Rev\. P4D/'))
316 316
317 317 @check("symlink", "symbolic links")
318 318 def has_symlink():
@@ -343,11 +343,11 b' def has_hardlink():'
343 343
344 344 @check("tla", "GNU Arch tla client")
345 345 def has_tla():
346 return matchoutput('tla --version 2>&1', r'The GNU Arch Revision')
346 return matchoutput('tla --version 2>&1', br'The GNU Arch Revision')
347 347
348 348 @check("gpg", "gpg client")
349 349 def has_gpg():
350 return matchoutput('gpg --version 2>&1', r'GnuPG')
350 return matchoutput('gpg --version 2>&1', br'GnuPG')
351 351
352 352 @check("unix-permissions", "unix-style permissions")
353 353 def has_unix_permissions():
@@ -377,7 +377,7 b' def has_root():'
377 377 @check("pyflakes", "Pyflakes python linter")
378 378 def has_pyflakes():
379 379 return matchoutput("sh -c \"echo 'import re' 2>&1 | pyflakes\"",
380 r"<stdin>:1: 're' imported but unused",
380 br"<stdin>:1: 're' imported but unused",
381 381 True)
382 382
383 383 @check("pygments", "Pygments source highlighting library")
@@ -393,7 +393,7 b' def has_pygments():'
393 393 def has_outer_repo():
394 394 # failing for other reasons than 'no repo' imply that there is a repo
395 395 return not matchoutput('hg root 2>&1',
396 r'abort: no repository found', True)
396 br'abort: no repository found', True)
397 397
398 398 @check("ssl", "ssl module available")
399 399 def has_ssl():
@@ -440,7 +440,7 b' def has_tic():'
440 440 try:
441 441 import curses
442 442 curses.COLOR_BLUE
443 return matchoutput('test -x "`which tic`"', '')
443 return matchoutput('test -x "`which tic`"', br'')
444 444 except ImportError:
445 445 return False
446 446
@@ -459,19 +459,19 b' def has_osx():'
459 459 @check("osxpackaging", "OS X packaging tools")
460 460 def has_osxpackaging():
461 461 try:
462 return (matchoutput('pkgbuild', 'Usage: pkgbuild ', ignorestatus=1)
462 return (matchoutput('pkgbuild', br'Usage: pkgbuild ', ignorestatus=1)
463 463 and matchoutput(
464 'productbuild', 'Usage: productbuild ',
464 'productbuild', br'Usage: productbuild ',
465 465 ignorestatus=1)
466 and matchoutput('lsbom', 'Usage: lsbom', ignorestatus=1)
466 and matchoutput('lsbom', br'Usage: lsbom', ignorestatus=1)
467 467 and matchoutput(
468 'xar --help', 'Usage: xar', ignorestatus=1))
468 'xar --help', br'Usage: xar', ignorestatus=1))
469 469 except ImportError:
470 470 return False
471 471
472 472 @check("docker", "docker support")
473 473 def has_docker():
474 pat = r'A self-sufficient runtime for'
474 pat = br'A self-sufficient runtime for'
475 475 if matchoutput('docker --help', pat):
476 476 if 'linux' not in sys.platform:
477 477 # TODO: in theory we should be able to test docker-based
@@ -489,11 +489,11 b' def has_docker():'
489 489 @check("debhelper", "debian packaging tools")
490 490 def has_debhelper():
491 491 dpkg = matchoutput('dpkg --version',
492 "Debian `dpkg' package management program")
492 br"Debian `dpkg' package management program")
493 493 dh = matchoutput('dh --help',
494 'dh is a part of debhelper.', ignorestatus=True)
494 br'dh is a part of debhelper.', ignorestatus=True)
495 495 dh_py2 = matchoutput('dh_python2 --help',
496 'other supported Python versions')
496 br'other supported Python versions')
497 497 return dpkg and dh and dh_py2
498 498
499 499 @check("absimport", "absolute_import in __future__")
General Comments 0
You need to be logged in to leave comments. Login now