Show More
@@ -11,7 +11,7 b' import tempfile' | |||
|
11 | 11 | |
|
12 | 12 | tempprefix = 'hg-hghave-' |
|
13 | 13 | |
|
14 | def matchoutput(cmd, regexp): | |
|
14 | def matchoutput(cmd, regexp, ignorestatus=False): | |
|
15 | 15 | """Return True if cmd executes successfully and its output |
|
16 | 16 | is matched by the supplied regular expression. |
|
17 | 17 | """ |
@@ -19,7 +19,7 b' def matchoutput(cmd, regexp):' | |||
|
19 | 19 | fh = os.popen(cmd) |
|
20 | 20 | s = fh.read() |
|
21 | 21 | ret = fh.close() |
|
22 | return ret is None and r.search(s) | |
|
22 | return (ignorestatus or ret is None) and r.search(s) | |
|
23 | 23 | |
|
24 | 24 | def has_symlink(): |
|
25 | 25 | return hasattr(os, "symlink") |
@@ -27,6 +27,12 b' def has_symlink():' | |||
|
27 | 27 | def has_fifo(): |
|
28 | 28 | return hasattr(os, "mkfifo") |
|
29 | 29 | |
|
30 | def has_cvs(): | |
|
31 | return matchoutput('cvs --version 2>&1', r'Concurrent Versions System') | |
|
32 | ||
|
33 | def has_cvsps(): | |
|
34 | return matchoutput('cvsps -h -q 2>&1', r'cvsps version', True) | |
|
35 | ||
|
30 | 36 | def has_executablebit(): |
|
31 | 37 | fd, path = tempfile.mkstemp(prefix=tempprefix) |
|
32 | 38 | os.close(fd) |
@@ -66,6 +72,8 b' def has_git():' | |||
|
66 | 72 | return matchoutput('git --version 2>&1', r'^git version') |
|
67 | 73 | |
|
68 | 74 | checks = { |
|
75 | "cvs": (has_cvs, "cvs client"), | |
|
76 | "cvsps": (has_cvsps, "cvsps utility"), | |
|
69 | 77 | "eol-in-paths": (has_eol_in_paths, "end-of-lines in paths"), |
|
70 | 78 | "execbit": (has_executablebit, "executable bit"), |
|
71 | 79 | "git": (has_git, "git command line client"), |
General Comments 0
You need to be logged in to leave comments.
Login now