File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 52
52
from readconfig import read_config
53
53
from opengrok import get_repos , get_config_value , get_repo_type
54
54
from shutil import which
55
+ import re
55
56
56
57
57
58
major_version = sys .version_info [0 ]
122
123
123
124
project_config = None
124
125
try :
125
- if config ['projects' ]:
126
- if config ['projects' ][args .project ]:
127
- project_config = config ['projects' ][args .project ]
126
+ projects = config ['projects' ]
127
+ if projects :
128
+ if projects .get (args .project ):
129
+ project_config = projects .get (args .project )
130
+ else :
131
+ for proj in projects .keys ():
132
+ try :
133
+ pattern = re .compile (proj )
134
+ except re .error :
135
+ logger .error ("Not a valid regular exception: {}" .
136
+ format (proj ))
137
+ continue
138
+
139
+ if pattern .match (args .project ):
140
+ project_config = projects .get (proj )
141
+ break
128
142
except KeyError :
129
143
# The project has no config, that's fine - defaults will be used.
130
144
pass
You can’t perform that action at this time.
0 commit comments