Mercurial > hg > orthanc-databases
annotate Resources/PostgreSQL/PrepareCMakeConfigurationFile.py @ 331:674bbb9d1c83
added OdbcEnvironment::GlobalInitialization()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 11 Aug 2021 07:28:53 +0200 |
parents | 8c7bb94adff7 |
children |
rev | line source |
---|---|
0 | 1 #!/usr/bin/python |
2 | |
3 import re | |
4 import sys | |
5 | |
6 if len(sys.argv) != 3: | |
7 raise Exception('Bad number of arguments') | |
8 | |
172
8c7bb94adff7
trying upgrade from libpq 9.6.1 to 13.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
9 r = re.compile(r'^#undef ([a-zA-Z0-9_]+)$') |
0 | 10 |
11 with open(sys.argv[1], 'r') as f: | |
12 with open(sys.argv[2], 'w') as g: | |
13 for l in f.readlines(): | |
14 m = r.match(l) | |
15 if m != None: | |
16 s = m.group(1) | |
17 g.write('#cmakedefine %s @%s@\n' % (s, s)) | |
18 else: | |
19 g.write(l) | |
20 |