summaryrefslogtreecommitdiff
path: root/client/utils/git.py
diff options
context:
space:
mode:
authorMark Wong2019-05-23 23:58:14 +0000
committerMark Wong2019-05-23 23:58:14 +0000
commitcf7a951b9580e6839464194547efe28757741e98 (patch)
treeaf463978ad8466b353afdbcc058648c9bb83613a /client/utils/git.py
parent8ebbbf47ca5483d6b7ed5679aac3a792c52252c7 (diff)
Update client code to install specific components
The pgbench directory and other utilities have moved around. Compensate by testing if the directory exists and try to install that component.
Diffstat (limited to 'client/utils/git.py')
-rw-r--r--client/utils/git.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/client/utils/git.py b/client/utils/git.py
index abef886..137e80d 100644
--- a/client/utils/git.py
+++ b/client/utils/git.py
@@ -91,8 +91,19 @@ class GitRepository(object):
call(['make', '-s', '-j', str(cpu_count()), 'install'],
cwd=self._path, stdout=strout, stderr=STDOUT)
- # Install pgbench from contrib in the older versions
- oldpgbenchdir = ''.join([self._path, '/', 'contrib/pgbench'])
- if os.path.isdir(oldpgbenchdir):
- call(['make', '-s', '-j', str(cpu_count()), 'install'],
- cwd=oldpgbenchdir, stdout=strout, stderr=STDOUT)
+ # Various things needs to be installed because of various changes
+ # changes between releases. Take a systematic approach and check
+ # if the directory exist, then try to install it.
+ items = [
+ 'src/bin/initdb',
+ 'src/bin/pg_ctl',
+ 'src/bin/scripts',
+ 'src/bin/psql',
+ 'src/bin/pgbench',
+ 'contrib/pgbench',
+ ]
+ for item in items:
+ srcdir = ''.join([self._path, '/', item])
+ if os.path.isdir(srcdir):
+ call(['make', '-s', '-j', str(cpu_count()), 'install'],
+ cwd=srcdir, stdout=strout, stderr=STDOUT)