File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
import sys
3
3
import logging
4
+ import os
5
+ import re
4
6
5
7
import mamonsu .lib .platform as platform
6
8
from mamonsu .plugins .pgsql .pool import Pooler
@@ -67,10 +69,18 @@ def _configure_extensions(self):
67
69
else :
68
70
libraries = libraries .split (',' )
69
71
libraries = [ext .strip () for ext in libraries ]
70
- if needed_libraries not in libraries :
71
- for ext in needed_libraries :
72
- if ext not in libraries :
73
- libraries .append (ext )
72
+ for candidate_ext in needed_libraries :
73
+ extension_found = False
74
+ for installed_ext in libraries :
75
+ # $dir/ext => ext
76
+ installed_ext = os .path .basename (installed_ext )
77
+ installed_ext = re .sub ('\.so$' , '' , installed_ext )
78
+ installed_ext = re .sub ('\.dll$' , '' , installed_ext )
79
+ # if any found
80
+ if installed_ext == candidate_ext :
81
+ extension_found = True
82
+ if not extension_found :
83
+ libraries .append (candidate_ext )
74
84
libraries = ',' .join (libraries )
75
85
self ._run_query (
76
86
"alter system set shared_preload_libraries to {0};" .format (
You can’t perform that action at this time.
0 commit comments