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 11# -*- coding: utf-8 -*-
22import sys
33import logging
4+ import os
5+ import re
46
57import mamonsu .lib .platform as platform
68from mamonsu .plugins .pgsql .pool import Pooler
@@ -67,10 +69,18 @@ def _configure_extensions(self):
6769 else :
6870 libraries = libraries .split (',' )
6971 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 )
7484 libraries = ',' .join (libraries )
7585 self ._run_query (
7686 "alter system set shared_preload_libraries to {0};" .format (
You can’t perform that action at this time.
0 commit comments